doubleclick Listbox item to open details form (1 Viewer)

WebFaktor

Registered User.
Local time
Today, 17:44
Joined
May 12, 2001
Messages
81
Hi - I am new at working with list boxes and would appreciative any help your experience could offer.

The following code will open a form (Example4_Details) when I double click an item found within a list (Field11) and
then allow me to enter details asociated with the double clicked item. My trouble is that before the form will open I am asked to enter a parameter value for the field (StateId)

On Error GoTo Err_Field11_DblClick
Dim strFormName As String
strFormName = "Example4_Details"
DoCmd.OpenForm strFormName, , , "[StateId] = " & Me.Field11
DoCmd.Close acForm, Me.Name
Exit_Field11_DblClick:
Exit Sub
Err_Field11_DblClick:
MsgBox Err.Description
Resume Exit_Field11_DblClick
 

WebFaktor

Registered User.
Local time
Today, 17:44
Joined
May 12, 2001
Messages
81
I figured it out. . .

The following did the trick.

Thanks anyway.


On Error GoTo Err_Field11_DblClick
Dim strFormName As String
strFormName = "Example4_Details"
DoCmd.OpenForm strFormName, , ("StateId = " & Field11.Column(0))
'DoCmd.Close acForm, Me.Name
Exit_Field11_DblClick:
Exit Sub
Err_Field11_DblClick:
MsgBox Err.Description
Resume Exit_Field11_DblClick
 

Users who are viewing this thread

Top Bottom