View Full Version : Setting focus to a control


Mel
02-13-2001, 06:08 AM
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.

R. Hicks
02-13-2001, 06:13 AM
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