Go to a specific record displayed within a query

C

CW

When a query displays its list of records, I would like to be able to click
on a chosen one and go to the main page (form) of that particular record i.e.
to drill down into it. The unique identifier is always the Ref. How can this
be done?
Many thanks
CW
 
W

Wayne-I-M

HI

There are quite a few methods, this is just one.
I would create a continous form based on the query.
Make sure the Record Selector is set to Yes (you'll a small box on the left
of each record)
Open the form in design view
Select a blank area outside the design (a grey area)
Right click
Select properties
Select Event Column
Select OnClick
Right click (select biuld ...)
Select code
Add this



Private Sub Form_Click()
If IsNull(Me.Ref) Then
MsgBox "Please select a record by single clicking the box to the left of a
name", vbInformation, "No record selected"
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Main Form to Open Name"
stLinkCriteria = "Ref =" & Me.Ref
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End Sub


Change Main Form to Open Name to the name of the form you want to open
Make sure that you have a control on each form called Ref

Good luck
 
C

CW

Well at least Wayne was being helpful, which is more than I can say about
your response.
If you know better than him, perhaps you'd like to share it with me rather
than just making a negative comment like that.
Thanks
CW
 

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