We help IT Professionals succeed at work.

Microsoft Access Table name

How do i set text box name if it has a space?
Snap1306.jpg
Comment
Watch Question

President / Owner
Fellow 2019
Most Valuable Expert 2017
Commented:
Me![Assignment Group].SetFocus

 Anything with a space or a special character needs to be enclosed in square brackets ( [ ] ).


Jim.
Hiroyuki TamuraField Engineer

Author

Commented:
thank you.
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Commented:
Well, I generally change the name of all of the controls on my forms, so that the control name is not identical to the field that is bound to it.  So I would recommend changing the name of the textbox to something like:

txtArgumentGroup

and refer to it as:

me.txtArgumentGroup.SetFocus

But if you don't want to do that, then you must wrap the name in brackets.

me![Argument Group]

But when you are referring to a control, you should use the dot (.) syntax, not the bang (!).  I only use bang when referring to a field in a recordset or which exists in a forms recordsource but does not have a corresponding control on the form.

me.[Argument Group]