My form has two list boxes. The user selects a value in listbox1, based on this value I would like a dynamic query to pull in the values then to populate listbox2 with them.
I inserted the following code into Listbox1’s Click event
Private Sub List1_Click()
Dim hold As String
hold = Me.List1.Value
'DoCmd.RunSQL ("SELECT FROM drawings WHERE drawings.[drawingNo] = " & hold & ";")
End Sub
Hold is returning the correct string but the sql is failing and I’m not sure why?
Also how do I associate the returned values with listbox2 so that they appear in listbox2.
Thanks for your time-
I inserted the following code into Listbox1’s Click event
Private Sub List1_Click()
Dim hold As String
hold = Me.List1.Value
'DoCmd.RunSQL ("SELECT FROM drawings WHERE drawings.[drawingNo] = " & hold & ";")
End Sub
Hold is returning the correct string but the sql is failing and I’m not sure why?
Also how do I associate the returned values with listbox2 so that they appear in listbox2.
Thanks for your time-