Setting focus to a control (1 Viewer)

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.
 

R. Hicks

AWF VIP
Local time
Yesterday, 22:56
Joined
Dec 23, 1999
Messages
619
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

Top Bottom