Double click on a listbox to open record

spnz

Registered User.
Local time
Today, 03:35
Joined
Feb 28, 2005
Messages
84
Hi there

I have a form that I have set up containing 2 pages (tabs) that cover the whole form.
When the form loads it opens pgeBookingDetails. PgeStart contains a listbox that is sourced by a query.

What I am trying to do is double click on the selected record within in the listbox and have code open up the 2nd page and display the records details.

The listbox has 5 columns. The 1st column displays tje primary key from the query(this is what I wish to use as a reference)

How can I have a double click event open the 2nd page and goto to my wanted record.

This is the code I have tried but it doesn't work.
Code:
Private Sub lstBookings_DblClick(Cancel As Integer)

Dim result As String
DoCmd.GoToControl ("pgeBookingDetails")
result = Me.lstBookings.Column(0)
DoCmd.GoToRecord , , acGoTo, result
End Sub

Does anyone have any suggestions?
 
I assume the listbox is not bound.
Base the forms data on a query using the listbox as criteria and requery the form on the afterupdate of the list.
HTH
Peter
 
Thanks Peter

Works great now

Shane
 

Users who are viewing this thread

Back
Top Bottom