form name with a space in the name

  • Thread starter Thread starter horstuff
  • Start date Start date
H

horstuff

Guest
How do I use a form name with a space in the name in the following command?

Forms!Purchase Orders!txtShippingMethod = 2

Thanks much.
 
Forms![Purchase Orders]!txtShippingMethod = 2

From the vba help screen on Form Object:

Syntax Example
Forms!formname Forms!OrderForm
Forms![form name] Forms![Order Form]
Forms("formname") Forms("OrderForm")
Forms(index) Forms(0)
 
To prevent problems like this its good practice to simply NOT use spaces and special characters in your names anywhere in the DB.

In the long run it will save you a ton of headaches

Regards
 

Users who are viewing this thread

Back
Top Bottom