Trying to refer to a column in a table but recieve error

2e1fmo

New member
Local time
Today, 15:40
Joined
Mar 7, 2002
Messages
9
Hi,

I am trying to call a function and take a value to the procedure. The value is a field in a table. this is the command

AddOwner !OwnerCode, !Holiday Sector

OwnerCode and Holiday sector are two fields in a table which I need to take over to the function AddOwner.

The problem occurs with the space between Holiday and Sector. I recieve the error:

Expected end of statement. and the word Sector is highlighted. Is their a value that i can insert to replace the space. The field must include the space between Holiday and Sector.

Was wondering if i could at the start of the code rename the column to HolidaySector and before it finsihed rename it back to Holiday Sector. But I dont know how to achieve this.

Any help or ideas would be extremely grateful
 
You could try Square brakets around the field name.
AddOwner !OwnerCode, ![Holiday Sector]

Access is not big on spaces in object names.
Chris
 

Users who are viewing this thread

Back
Top Bottom