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!

How to activate a Query using the current Form Record as the criteria

Status
Not open for further replies.

BruceJackson

Technical User
Apr 30, 2003
29
0
0
GB
How to activate a Query using the current Form Record as the criteria?

EG: looking at order no: 012345 in the form and running a query to append this order and other related data into a different table without the need to type in the order no.

Any ideas please?
 
You can refer to a form in the criteria line of a query:
[tt]=Forms!frmForm!OrderNo[/tt]

Or you can run a query through code:
[tt]strSQL="Update tblTable Set Field1='ABC' Where OrderNo=" _
& Forms!frmForm!OrderNo
DoCmd.RunSQL strSQL[/tt]
 
You can refer to a form in the criteria line of a query:
=Forms!frmForm!OrderNo

Spot on!

Thankyou Remou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top