Field names with spaces

Mod

DoCmd.PostForHelp
Local time
Yesterday, 19:35
Joined
May 4, 2004
Messages
70
How can i refer to a field name of a RecordSet variable if the field in question has a space or other funky character?
Code:
REM the name of the field in this example is Field #Name

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Table 1")
...
SubRoutine(rst!Field #Name)
SubRoutine(rst!Field\ \#Name)
SubRoutine(rst!"Field Name")

And I can't think of anything else to try :(
 
Mod said:
How can i refer to a field name of a RecordSet variable if the field in question has a space or other funky character?
Code:
REM the name of the field in this example is Field #Name

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Table 1")
...
SubRoutine(rst!Field #Name)
SubRoutine(rst!Field\ \#Name)
SubRoutine(rst!"Field Name")

And I can't think of anything else to try :(

SubRoutine(rst![Field Name])
 
which is exactly why you shouldnt use spaces in names ..... *geez*
 

Users who are viewing this thread

Back
Top Bottom