Hello Guys,
I need some help.
I have a form with a textbox (to type a name), a listbox1 (that brings up the licenses for each person), and another listbox2 (that is supposed to bring up certificates associated with that license).
From the name textbox to the 1st listbox1 it works. Now when I want to click one of the value in that listbox1 to generate the certificate associated with it in listbox2 nothing happens.
Here is the code from textbox to listbox 1
Private Sub cmdSearchName_Click()
Dim strLoad As String
Dim task As String
Dim strSpacefix As String
If Not IsNull(Me.FName) Then
'Load the text box contents
strLoad = Me.FName.Value
strSpacefix = Replace(strLoad, "", "" & "*"" AND [EmpID] LIKE ""*" & "", 1, -1)
task = "SELECT State,LicNum,Expires FROM Qry_PEStateLicCert WHERE ([FName] LIKE ""*" & strSpacefix & "*"")"
Me.ListBoxStateLic.RowSource = task
Me.ListBoxStateLic.Requery
Me.ListBoxStateLic = Me.ListBoxStateLic.ItemData(1)
End If
End Sub
Private Sub FName_AfterUpdate()
Call cmdSearchName_Click
End Sub
but I am stuck at to what to do for ListBox2 (ListCert)
Thank you for your help
I need some help.
I have a form with a textbox (to type a name), a listbox1 (that brings up the licenses for each person), and another listbox2 (that is supposed to bring up certificates associated with that license).
From the name textbox to the 1st listbox1 it works. Now when I want to click one of the value in that listbox1 to generate the certificate associated with it in listbox2 nothing happens.
Here is the code from textbox to listbox 1
Private Sub cmdSearchName_Click()
Dim strLoad As String
Dim task As String
Dim strSpacefix As String
If Not IsNull(Me.FName) Then
'Load the text box contents
strLoad = Me.FName.Value
strSpacefix = Replace(strLoad, "", "" & "*"" AND [EmpID] LIKE ""*" & "", 1, -1)
task = "SELECT State,LicNum,Expires FROM Qry_PEStateLicCert WHERE ([FName] LIKE ""*" & strSpacefix & "*"")"
Me.ListBoxStateLic.RowSource = task
Me.ListBoxStateLic.Requery
Me.ListBoxStateLic = Me.ListBoxStateLic.ItemData(1)
End If
End Sub
Private Sub FName_AfterUpdate()
Call cmdSearchName_Click
End Sub
but I am stuck at to what to do for ListBox2 (ListCert)
Thank you for your help