Go to Record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to go to a record by double clicking a field with that record in it.

I have a form which has a self join on it called 'Link'. This is a combo box
field that contains a drop down box of the other events in that table. When
events are linked, it is selected by the user. I would like to be able to
double click the box and the form take you to that record.

I have the following code:

Private Sub Linked_Event_DblClick(Cancel As Integer)
Dim strEvent As Integer
strEvent = [Linked Event]
Debug.Print strEvent
DoCmd.FindRecord ([Event Number] = strEvent)
End Sub

The debug.print shows the correct event but the form points to the previous
record rather than the record contained within the field.

Thanks
 
Thanks for the link...however, I followed the procedure as suggested but the
same is still happening. The form does not change record. My code is as
follows:

Private Sub Linked_Event_DblClick(Cancel As Integer)
DoCmd.ShowAllRecords
Me![Linked Event].SetFocus
DoCmd.FindRecord Me![Linked Event]
End Sub

I have taken out the last part as I do not want the combo box to be cleared
once I double click. Maybe it is because the combo box is a record in the
table?

Ofer Cohen said:
Look at this link on "Using a Microsoft Access Combo Box to Search for a
Record"

http://www.databasedev.co.uk/combo_box_search.html
--
Good Luck
BS"D


rjw24 said:
I want to go to a record by double clicking a field with that record in it.

I have a form which has a self join on it called 'Link'. This is a combo box
field that contains a drop down box of the other events in that table. When
events are linked, it is selected by the user. I would like to be able to
double click the box and the form take you to that record.

I have the following code:

Private Sub Linked_Event_DblClick(Cancel As Integer)
Dim strEvent As Integer
strEvent = [Linked Event]
Debug.Print strEvent
DoCmd.FindRecord ([Event Number] = strEvent)
End Sub

The debug.print shows the correct event but the form points to the previous
record rather than the record contained within the field.

Thanks
 

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

Back
Top