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

Query Loading Form?

Status
Not open for further replies.

shauntck

Programmer
Jul 13, 2004
19
0
0
US
Hey guys, i'm looking to run an access query and some how double click or select a row and push a button that will pull up a form that i created with that record loaded. Is there a way to do this?
-Shaunt
 
base the query criteria field on the form control contants

"My God! It's full of stars...
 
Can you be a little more specific? I'm somewhat new to access and I don't understand what you are saying.

Thanks,
-Shaunt
 
Anybody have any advise as to how to go about doing this???
thanks,
-Shaunt
 
Queries don't have event's, and besides, you don't want to let your users have access to tables and queries, but forms.

This can easily be achieved in a continuous form with your current query as recorsource. Then create a button with something like this in the on click event procedure:

[tt]docmd.openform "yourform",,,"PKField = " & me!txtPKcontrol.value[/tt]

Use the name of the form you need to open, PKField, is the name of the primary key or unique field you filter on, and txtPKControl the name of the control on the current form holding this value.

BTW - Welcome to Tek-Tips!

To get the most out of the membership, take a look at this faq faq181-2886, and try to get familiar with the faq section and keyword search of the fora (see the tabs at the top of the page).

Good Luck!

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top