D
Draedric
I have been working on being able to double click a listbox that returns
records from a search and have the double click open a form with that record
on it.. i have 4 different search options using checkboxes which only one can
be selected at a time here is the code i am using but nothing happens on
double click no errors or anything, anyone tell me what is wrong with it?
Private Sub lbxResults_DblClick(Cancel As Integer)
Dim strFormName As String, strCriteria As String
Select Case inCTL.Name
Case "chkTbl1" 'Customer1
strFormName = "Cust1_Search_Results"
strCriteria = "[CustName]='" & Me!lbxResults.Column(0) & "'"
Case "chkTbl2" 'Customer2
strFormName = "Cust2_Search_Results"
strCriteria = "[Cust2Name]='" & Me!lbxResults.Column(0) & "'"
Case "chkTbl3" 'Cust3
strFormName = "Cust3_Search_Results"
strCriteria = "[Cust3Name]='" & Me!lbxResults.Column(0) & "'"
Case "chkTbl4" 'Cust4
strFormName = "Cust4_Search_Results"
strCriteria = "[Cust4Name]='" & Me!lbxResults.Column(0) & "'"
Case Else
Exit Sub
End Select
DoCmd.OpenForm strFormName, , , strCriteria
End Sub
records from a search and have the double click open a form with that record
on it.. i have 4 different search options using checkboxes which only one can
be selected at a time here is the code i am using but nothing happens on
double click no errors or anything, anyone tell me what is wrong with it?
Private Sub lbxResults_DblClick(Cancel As Integer)
Dim strFormName As String, strCriteria As String
Select Case inCTL.Name
Case "chkTbl1" 'Customer1
strFormName = "Cust1_Search_Results"
strCriteria = "[CustName]='" & Me!lbxResults.Column(0) & "'"
Case "chkTbl2" 'Customer2
strFormName = "Cust2_Search_Results"
strCriteria = "[Cust2Name]='" & Me!lbxResults.Column(0) & "'"
Case "chkTbl3" 'Cust3
strFormName = "Cust3_Search_Results"
strCriteria = "[Cust3Name]='" & Me!lbxResults.Column(0) & "'"
Case "chkTbl4" 'Cust4
strFormName = "Cust4_Search_Results"
strCriteria = "[Cust4Name]='" & Me!lbxResults.Column(0) & "'"
Case Else
Exit Sub
End Select
DoCmd.OpenForm strFormName, , , strCriteria
End Sub