VBA Syntax

  • Thread starter Thread starter JL
  • Start date Start date
J

JL

I've used access for a while, but I'm just getting started with VBA.
On a form I'm trying to set a text box's control source. The control
source will depend on user input from another form(menu). I'm good with
the If then statements, but I can't seem to get the syntax right for
setting the control source. This is my code.

Me.TextBox.ControlSource = Me.[Q2 Budget]

Thanks so much. JL
 
The code you posted will look for a field (or control)named Q2 Budget on the
form that is running the code, and then put the value of that field or
control in the control source for TextBox.

I think what you want is to put the Q2 Budget name in the Control Source? If
yes, use this:

Me.TextBox.ControlSource = "Q2 Budget"
 
Back
Top