Setting focus to a control

  • Thread starter Thread starter Mel
  • Start date Start date
M

Mel

Guest
I there a way to get around having to setfocus to a control before assigning the text property a value in code? In VB you don't have to set the focus to the control before assigning a value to it. For example,

Access
TextBox.setfocus
TextBox.text = "Something"

VB
TextBox.text = "Something"

if you try to assign a value you get an error message saying the control must have the focus.
 
You should be able to use:

Me.YourTxtboxName = "Something"
Or
Me![YourTxtboxName] = "Something"

If the txtbox is on the currently active form, the above should work.

HTH
RDH
 

Users who are viewing this thread

Back
Top Bottom