Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One expression - for seveal Parameter Queries

Status
Not open for further replies.

bluemat

Technical User
Feb 5, 2002
61
0
0
MX
I would like ot be able to put one value for several parameter queries qhich have the same field in common.

At the moment I have a form where users can select from option groups to select the reports they would like yto print. However, when the print messages for each report appear they have to input the parameter whcih is common to them all - the ID number. They have to enter this number up to 5 times.

I would like them to put the number in a filed, select their reports from option groups and then press print. The rest should be automatic.

Can you help?

Thanks

Mathew
 
Perhaps. It really depends on how 'technical' a user you are. The process needs to have some code. It is not very difficult, but does require understanding of querydef objects as well as how to (in code) generate a recordset based n a querydef.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
I think a solution might be to set the ID Number to a global variable, then have the query reference the ID Number global variable via a function...

Something like this:

Create a global variable in a module:

public glngIDNumber as long

Then create a function:

'Assuming your ID Number is a long number

public function GetGlobalID as long
GetGlobalID = glngIDNumber
end function


Then on your queries to the reports, in the criterica put the following for the ID Number field:

= GetGlobalID()


Then before you call the reports, set the global variable (glngIDNumber) equal to the ID Number you want as the criteria. Something like:

'on the click event of the command button through a text box:

glngIDNumber = me!txtTheIDNumber

or:

glngIDNumber = inputbox ("Please enter the ID Number")


If this makes no sense, let me know and I can refine it a bit for you.

Hope this helps,

Jeff


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top