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

Double click field to bring up a form with right data

Status
Not open for further replies.

jofarrell

Programmer
Mar 21, 2001
178
US
I am wondering how I can double click a field and then bring up another form that asks for one piece of information as well as using the value that was selected to basically be there "where" part of a SQL statement and populate a form with queried data.

so if I have a field deptcode I want to be able to ask for the DeptNo. and then display on another form all data relevant to that deptNO and that deptCode.

Any suggestions are greatly appreciated. I have a query that I call but it doesnt recognize the value I selected.

Joanne
 
Hi!

Here's what you need to do. Build a form based on you query(which I assum is done). In the criteria for the deptNO put [Please Enter the Dept. No.: ] In the double click event of your text box(or list box/combo box) put this code:

DoCmd.OpenForm "YourFormName", , , "deptcode = '" & Me!YourControlName & "'"

That should open the form correctly.

Alternatively, you could put in the deptcode criteria of the query:

[Forms]![YourFormName]![YourControlName]

hth
Jeff Bridgham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top