Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

Why getting compile error on doubleclick event in a listbox

Using the following code I get a compile error: variable not defined error when doubleclicking on a record in a listbox.  When I double-click on the record it is supposed to open a form to the selected record.

Here is my code:

Private Sub List223_DblClick(Cancel As Integer)

    If IsNull(Me.List223) Then
        DoCmd.OpenForm "frmScriptureRecordEntry", , , , acFormAdd
    Else
         strCriteria = "[RecordID] = " & Me.List223.Column(0)
         DoCmd.OpenForm "frmScriptureRecordEntry", , , strCriteria

End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial