In VBA, reference the values of control properties defined in Design mode when in Run mode.

jacky Perpète 41 Reputation points
2023-05-05T08:28:10.8033333+00:00

Hello,

Is it possible in VBA, to reference the values of control properties defined in Design mode when in Run mode?

Example of simple use:

If I set the font color value of a textbox to red in design mode, I want in run mode to be able to reposition that color to red by referencing the design mode color.

The Design Mode color would be used as the default color.

Access
Access
A family of Microsoft relational database management systems designed for ease of use.
321 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 42,386 Reputation points
    2023-05-05T08:49:02.3633333+00:00

    Sure you can, but you will a numeric value (RGB)

    Public Sub Befehl5_Click()
    
        MsgBox ("The background color is: " & myTextBox.BackColor)
        
    End Sub
    
    0 comments No comments

  2. jacky Perpète 41 Reputation points
    2023-05-05T09:06:16.9833333+00:00

    Thank you for your reply.

    Maybe I wasn't clear enough in my question.

    In my VBA code the font color changes value.

    At some point, I would like to reposition it with the color defined in design mode.

    How to find this design mode value in VBA?