Missing Operator in Query Expression

wezhogan

Registered User.
Local time
Today, 10:00
Joined
May 24, 2012
Messages
16
I have a form based on a query. The query populates a combo box and when a name is selected from the combo box it updates the value in a text box on the form with the ID number of the record selected. The value in the combo box is created from this expression: Expr1: [Contacts]![First Name] & " " & [Contacts]![Middle Name] & " " & [Contacts]![Last Name]

After the user selects a value from the combo box, they click a Next button which uses a macro to open another form with the record corresponding to the first forms IDNumber. This is the where statement used in the macro: ="[IDNumber]=" & [Forms]![frmSelectContact]![IDNumber]

If I open that first form manually it works fine opening up the second form to the correct record. If I open the first form from my switchboard form that is not based on any table or query it give me the following error: Syntax Error (Missing Operator) in query expression '[IDNumber]='

I'm not sure why it works one way and not the other way. Any ideas?

Thanks
 
I have a form based on a query. The query populates a combo box and when a name is selected from the combo box it updates the value in a text box on the form with the ID number of the record selected. The value in the combo box is created from this expression: Expr1: [Contacts]![First Name] & " " & [Contacts]![Middle Name] & " " & [Contacts]![Last Name]
What is the Record Source for the Combo Box.
Could you please post the SQL.
 
The combo box is poulated by Expr1 in this query:

SELECT Contacts.IDNumber, Contacts.[First Name] & " " & Contacts.[Middle Name] & " " & Contacts.[Last Name] AS Expr1
FROM Contacts;
 
If I open that first form manually it works fine opening up the second form to the correct record. If I open the first form from my switchboard form that is not based on any table or query it give me the following error: Syntax Error (Missing Operator) in query expression '[IDNumber]='

I do not understand. You say you have a Form that opens correctly but then it doesn't if yu use the Switchboard.

What are you doing that is different. If it is the same Form then it has the same query as the recordsource.

The Combo has nothing to do with this. All that comes later.

Please explain.
 
When you say "switchboard form" are you really using the switchboard, or are you using a navigation form that has the form embedded in it? If it's the latter, I've seen instances where a form embedded in the navigation form that accepts and passes parameters doesn't work correctly because it seems like Access thinks the form isn't open.

My solution was to use a command button on a navigation form to lauch the form separately.

If you're really using the switchboard, disregard this.
 
This is the sequence of how it is suposed to work:

Navigation Form (User clicks a button to Open the Client Selection Form) -->
Client Name Selection Form (User selects a client name from a combo box then clicks a button to open the Client Detail Form) -->

Client Detail form opens in edit mode with record corresponding to the client name chosen earlier.

When the User attempt to open the Client Detail Form using the above sequence I get the error. If we skip the Navigation Form and begin the sequence by going straight to the Client Selection Form and opening the Client Detail Form from there it works correctly.

Does this make more sense?
 
It would appear that something is wrong with the Source Code for the Form.

We have a Form that opens correctly from the Nav Pane but does not from, (I assume a menu that you created).

Mostly educated guessing here but I assume the Source Code refers to something that is not open but should be.

No one else has jumped in with a solution so I think the next step is to post a copy of a cut down version of the Database.
 
This is the sequence of how it is suposed to work:

Navigation Form (User clicks a button to Open the Client Selection Form) -->
Client Name Selection Form (User selects a client name from a combo box then clicks a button to open the Client Detail Form) -->

How did you place the command button into the navigation form? Can you post the code behind the button that opens the Client Selection Form?

If you didn't do it this way, try creating a form with a command button to open the Client Selection Form. If that works ok, add that form with the button to the navigation form and see if the Client Selection Form then launches ok. I agree with Rain's thinking that something that should be open isn't.
 

Users who are viewing this thread

Back
Top Bottom