Query not recognizing OrderID field from form

RickDB

Registered User.
Local time
Today, 12:28
Joined
Jun 29, 2006
Messages
101
Hello,

I am running a append query from a button.

In the query, I have set the OrderID criteria to:
[Forms]![sfrmOrders]![txtOrderID]
Whenever I try to run the query from the open form & subform, an Access 'Enter Parameter Value' window pops up.

I would like to use this Criteria for many different features in my db (SendObject, etc.), but I cannot find how to set the OrderID based on the current form.

If anyone can see what I am doing wrong, I would appreciate your help!

Thanks!
 
[txtOrderID] implies a label name. What is the name in the Control Source of the Data Tab of Properties? lightray
 
I have also tried [Forms]![sfrmOrders]![OrderID] with the same results.

Also, I have tried pointing the query directly to the table storing the OrderID, and the query that is the recordsource for my form (just for kicks). All with the same results.

Evidently I have a serious misunderstanding here, but I thought this is how most people change query parameters on the fly.
 
No love on that sample for what I need :confused:

It seems some of the most basic, simple things really need to be cause for serious headache when it somes to access. Hopefully 2007 has some improved intuitive tools for implementing these basic features.
 
silly thing, rick, but is sfrmorders open. also if sfrmorders is a SUBFORM then you are referring to it incorrectly. Or you have no field on your form called orderid or txtorderid - if access can't find what you put in, it prompts you as a parameter.
 
I'm going to have to send payment for all the times you've helped me out in the past week (if it is of any consolation, the db we use has drastically improved in the past week).

The field OrderID is there, and I made a second additional field named txtOrderID in my trial and error run... Yes, sfrmOrders is a Subform, I am doing a search on that now...

I assume then that the first [Forms]! value changes? Or do I have to add in reference to its master form as well?

Thanks again!!!
 
Someone posted this in another thread:

From memory:

[forms]![frmCustomers].[sfrmOrders].form![course date]

But that is not it (at least it is not working for me)

When that is placed into the query as criteria, Access changes it to this:

[forms]![frmCustomers].[sfrmOrders].[form]![course date]
 
Last edited:
look in help, "forms, referring to in expressions" - that will have the right syntax

why [course date]? - i assume you mean txtorderid
 
gemma-the-husky said:
look in help, "forms, referring to in expressions" - that will have the right syntax

why [course date]? - i assume you mean txtorderid

Yes, I had OrderID in there, I just did a fast copy and paste from another thread for illustration purposes...

Thanks You!
 

Users who are viewing this thread

Back
Top Bottom