Using ONCLICK on a form to retrieve a record

R

Richard B.

Please help!!! I have a form that brings up rows of
records. I would like the user to mouse click on the
record id field (which is a autonumber)and have it call up
another form showing the clicked on record and all its
fields.

Thanks.
 
D

Dirk Goldgar

Richard B. said:
Please help!!! I have a form that brings up rows of
records. I would like the user to mouse click on the
record id field (which is a autonumber)and have it call up
another form showing the clicked on record and all its
fields.

This is simple enough -- just write an event procedure for the RecordID
field. If the detail form is called "frmDetails", your code might look
something like this:

Private Sub RecordID_Click()

DoCmd.OpenForm "frmDetails", _
WhereCondition:="RecordID=" & Me.RecordID

End Sub

You would also have to substitute the name of the primary key field for
"RecordID" where it appears in the above code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top