
December 21st, 2003, 02:30 AM
|
|
Registered User
|
|
Join Date: Dec 2003
Location: New Zealand
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
OpenForm method in Access 2000 using a variable
I'm trying to open a form in Form view so that it displays a record with the value of a variable called "custname". If I use this code, where the name is entered it works:
DoCmd.OpenForm "Customers",,,"Company = 'Jones'" BUT when I change it to:
DoCmd.OpenForm "Customers",,,"Company = " & custname
I get an error - missing operator.
(The variable has been declared and I've checked that it has the correct value at the point where this line of code is read.)
I know this will be Programming 101 to most of you, but I'm a newbie - please forgive me for asking such a banal question.
robroynz
Last edited by robroynz : December 21st, 2003 at 02:35 AM.
|