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

Open another form

Status
Not open for further replies.

mrbboy

Technical User
Feb 28, 2007
136
US
I have a form, frm_Metrix, for viewing the number of audit items performed during an audit. The record source of this form is tbl_Audit which has:

tbl_Audit

AuditID <key>
Item No <Number>

I have another form, frm_Audit, that is used to enter all the audit items into tbl_Audit.

In frm_Metrix, I have a text box, txt_ItemNo, in the details section of the form. When the form is viewed, all the audit items are listed. Is it possible to click on any of the items in txt_ItemNo, i.e. item no 6 for example, and immediately open up another form and have the records for that item listed?

 
DoCmd.OpenForm "newformname", , ,"itemNoForeignKey = " & me.txt_ItemNo
 
that assumes your foriegn key is numeric. Look in the help file under "openForm method" for other examples.
 
yes. Take a look at docmd.openform command, call this in the onclick event of the of the items ie textboxes.


Ian Mayor (UK)
Program Error
9 times out of 10 I know what I'm talking about. This must be my tenth reply.
 
How are ya mrbboy . . .

I agree with [blue]ProgramError[/blue] only I'd use the [blue]Dbl Click[/blue] event. It allows the user to set focus to the control with a single click, without triggering the code . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
I have change my mind and I agree with theaceman a double click would be better suited.


Ian Mayor (UK)
Program Error
9 times out of 10 I know what I'm talking about. This must be my tenth reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top