G
Guest
I have looked at the threads in search of a solution to my problem but most
of the ones I found were for cascading combo box. I am trying to populate a
combo box dependent on what value is in a bounded text box. I tried putting
the SQL on the row source of the combo box property and when that didn't work
I wrote VBA code for the On Load event of the form. Here is the code that I
wrote:
If Not IsNull(Me!ProductName.Value) Then
Dim MySQL As String
MySQL = "Select distinct MSP.[Product]"
MySQL = MySQL + " From [Master_SoftwareProduct] MSP "
MySQL = MySQL + " Where """ + Me!ProductName.Value + """ is not null"
MySQL = MySQL + " And MSP.[Product] like """ + Me!ProductName.Value + "%"""
Me!ProductComboBox.RowSourceType = "Table/Query"
Me!ProductComboBox.RowSource = MySQL
End If
I am not getting anything in the combo box. I ran the SQL independently and
it gave me results back. Any help is appreciated.
of the ones I found were for cascading combo box. I am trying to populate a
combo box dependent on what value is in a bounded text box. I tried putting
the SQL on the row source of the combo box property and when that didn't work
I wrote VBA code for the On Load event of the form. Here is the code that I
wrote:
If Not IsNull(Me!ProductName.Value) Then
Dim MySQL As String
MySQL = "Select distinct MSP.[Product]"
MySQL = MySQL + " From [Master_SoftwareProduct] MSP "
MySQL = MySQL + " Where """ + Me!ProductName.Value + """ is not null"
MySQL = MySQL + " And MSP.[Product] like """ + Me!ProductName.Value + "%"""
Me!ProductComboBox.RowSourceType = "Table/Query"
Me!ProductComboBox.RowSource = MySQL
End If
I am not getting anything in the combo box. I ran the SQL independently and
it gave me results back. Any help is appreciated.