Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to reference a form in code when blanks are present in form name

Status
Not open for further replies.

RBPM

IS-IT--Management
Jan 14, 2005
59
US
Good afternoon to the forum. My question is how to refer to a field in a form when there are blanks (spaces) in either the form or field name?

The form name is two words ie: Accept Work

Am trying to refer to the form in event code using:

Forms!Accept Work!Text29

Thanks for your help.
 
Using [brackets]

[tt]Forms![Accept Work]!Text29[/tt]

or parenthesis/quote style

[tt]Forms("Accept Work")("Text29")[/tt]

Roy-Vidar
 
Hi!

You use square brackets:

Forms![Accept Work]!Text29

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
geomorpgh - as with the .value property that it seems most members here drops of when referencing, the .controls collection is also default, and doesn't need to be used, though should it be used, and it is my preference to do so, I do the whole enchillada, both default collection and default property...

[tt]Forms("Accept Work").Controls("Text29").Value[/tt]

Though it is also fair to note that when referencing in queries and controlsources, the bang syntax must be used, and without property.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top