G
g3000
I am using Access 2003 on Win2K3 Server EE
I created a form with one combo box an one list box.
The combo box is based on a select distinct of last names from a table.
After the combo box is updated the list box will filter on that value.
Below is my code:
Private Sub Combo3_AfterUpdate()
Dim myQuery As String
myQuery = "SELECT PERSONAL.ID, " & _
"PERSONAL.SALUTATION, " & _
"PERSONAL.FNAME, " & _
"PERSONAL.LNAME, " & _
"PERSONAL.CITY, " & _
"PERSONAL.STATE " & _
"FROM PERSONAL " & _
"WHERE PERSONAL.LNAME =" & Me.Combo3.Value & _
"ORDER BY [LNAME];"
[List7].RowSource = myQuery
[List7].Requery
End Sub
When I update the combo box the list box is not updated.
Is this the hard way. Is there a better way?
Thanks for your time. Im new to VBA not programming.
I created a form with one combo box an one list box.
The combo box is based on a select distinct of last names from a table.
After the combo box is updated the list box will filter on that value.
Below is my code:
Private Sub Combo3_AfterUpdate()
Dim myQuery As String
myQuery = "SELECT PERSONAL.ID, " & _
"PERSONAL.SALUTATION, " & _
"PERSONAL.FNAME, " & _
"PERSONAL.LNAME, " & _
"PERSONAL.CITY, " & _
"PERSONAL.STATE " & _
"FROM PERSONAL " & _
"WHERE PERSONAL.LNAME =" & Me.Combo3.Value & _
"ORDER BY [LNAME];"
[List7].RowSource = myQuery
[List7].Requery
End Sub
When I update the combo box the list box is not updated.
Is this the hard way. Is there a better way?
Thanks for your time. Im new to VBA not programming.