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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Starting a prewritten query from a form 1

Status
Not open for further replies.

encodeme

Programmer
Joined
Jul 8, 2005
Messages
14
Location
PT
I have a table called Customer and this is linked to a form Customers.

I would like to start a pre written parameter style query from this form but only want to include the customer information of the Customer showing on the open form i.e. the current open record.
I am not sure how to do this.
 
Well you must know the recordsource of the org. form so you open the new form with this recordsource via "OpenArgs".

Just add "Where CoustomerID=" & me!CoustomerID to the recordset.

Herman

They say that crime doesn't pay... does that mean my job is a crime?
 
How are ya encodeme . . .
[ol][li]Design your parameter query (be sure to include the [blue]PK[/blue] of table customer).[/li]
[li]In the criteria for [blue]PK[/blue]:
Code:
[blue]Forms!Customer!PKname OR Forms!Customer!PKname Is Null[/blue]
[/li][/ol]
Of course form customer has to be open when you run the query . . .

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top