Microsoft Access Table name

Hiroyuki Tamura
Hiroyuki Tamura used Ask the Experts™
on
How do i set text box name if it has a space?
Snap1306.jpg
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012
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]

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial