Access 2000: Wilcard in Access SQL statement?

BrianE

Registered User.
Local time
Today, 14:06
Joined
Mar 6, 2008
Messages
10
I have an Access SQL statement (Using Access 2000)that contains the line:

WHERE ((([tblResupplyOrder Numbers].[Our Order Number])=[Forms]![frmEditOrder]![Combo51])

This query is used to populate a report, but being conditional it only works when I drive it from form [frmEditOrder].

I want to wildcard [frmEditOrder] so that any form with a Combo51 can drive the query and the report.

Otherwise I have to replicate the query and report with a new form name for each one.

Thanks in advance for any help.
 
First question: what makes you think you would have more than one form with a control called Combo51?
 
Hi Mile-O

Two reports called from two different forms. The Forms both display the same Order Number, but in different currencies. I have set the Combo properties to both be Combo51, both in the VBA and the Properties dialog in the Form Design.

Basically, what I am doing is printing an Order in two different currencies. I have had to create a new query to populate the second report, as the first query has that conditional statement in it.

For the life or me, I cannot figure a work-around.

B.
 
You have one form for each currency? :confused: Is this the same form copies and renamed for this purpose?

I think there may be some greater problem involved with this database.
 
You have one form for each currency? :confused: Is this the same form copies and renamed for this purpose?

I think there may be some greater problem involved with this database.

No, it is two different forms, displaying the information relating to each currency via a forex rate query calculation. I have named the Combo that selects the order in question the same on both forms, but they can never be both open at the same time, so whilst it could be a risk, I have set close statements for each form in the open action for the other form if you follow what I mean :)

Now for the SQL wildcard work-around.....
 
Now for the SQL wildcard work-around.....
That's what I'm getting round to you. You can put wildcards in criteria, but you can't wildcard a parameter itself because, it's going to want you have both parameters available, whatever the cost.

You are going to need a bigger solution than what you seem to think. But I suppose, with the limited details, I don't understand you database and can't comment further until you can provide better detail.

Of course, you should be able to build the query in VBA on your form. But I don't know your process, your thinking, etc.
 
Why do you need two forms? If it was me, I'd use a combo box to select the currency in the form.
 
Simple Software Solutions

Hi

I have mentioned this in a few threads.

If you declare public variables on app open then create a function to spit out the variable you can call the function in the query or report from anywhere in the app.

please see the attachment below:

codeMaster::cool:http://www.icraftlimited.co.uk
 

Attachments

Users who are viewing this thread

Back
Top Bottom