J
Jay
I have a List Box Subform of Customers [frmContactsAll], whereby, when you
double click and choose a particular customer from the list, the unique
identifier "Customer ID" is used to open a second form
called[frmSelectedCustomerContact].
My OnClick code is: DoCmd.OpenForm "frmSelectedCustomerContact", , ,
"CustomerID =" & Me.List where 'List' is my List Box.
This second form ([frmSelectedCustomerContact]) displays particular customer
details taken from the first form.
Up until this point, this works perfectly.
The problem arises when I introduce an "On Load" event within both
forms. -When the Second form 'loads', I close the first form.
-Conversely, if I want to return to the first form again when sitting in the
second form, I close the second form when the first form re-loads.
After the first form re-loads [and by all accounts takes me back "to the
start" to repeat the original steps], now when I double click and choose a
particular customer from the list once more (in order to open the second
form again), my code DoCmd.OpenForm "frmSelectedCustomerContact", , ,
"CustomerID =" & Me.List doesn't work and I receive the following error.
Run-time error '3075':
Syntax error (missing operator) in query expression 'CustomerID='.
Any help greatly appreciated....Regards, Hason
double click and choose a particular customer from the list, the unique
identifier "Customer ID" is used to open a second form
called[frmSelectedCustomerContact].
My OnClick code is: DoCmd.OpenForm "frmSelectedCustomerContact", , ,
"CustomerID =" & Me.List where 'List' is my List Box.
This second form ([frmSelectedCustomerContact]) displays particular customer
details taken from the first form.
Up until this point, this works perfectly.
The problem arises when I introduce an "On Load" event within both
forms. -When the Second form 'loads', I close the first form.
-Conversely, if I want to return to the first form again when sitting in the
second form, I close the second form when the first form re-loads.
After the first form re-loads [and by all accounts takes me back "to the
start" to repeat the original steps], now when I double click and choose a
particular customer from the list once more (in order to open the second
form again), my code DoCmd.OpenForm "frmSelectedCustomerContact", , ,
"CustomerID =" & Me.List doesn't work and I receive the following error.
Run-time error '3075':
Syntax error (missing operator) in query expression 'CustomerID='.
Any help greatly appreciated....Regards, Hason