hai,
I am trying to create a simple form in access project with a combo box and a list box that populates the values based on the value selected from the combo box.My VB code is as follows.
Dim Evar As String
With Me
fVisible = Not IsNull(.cbo) ----cbo is the combo box
.lstAssets.Visi ble = fVisible ----lstAssets is the listbox
If fVisible Then
Evar=.cbo.text -----I also tried SelText
strSQL = "EXECUTE sp_testbyvar " & Evar
.lstAssets.RowS ource = strSQL
.lstAssets.Requ ery
.lstAssets.Visi ble = True
End If
End With
For some reason, when i am trying to run the form, the list box is not generating the values.I realised that the variable Evar is reading the value form Me.cbo.text(or SelText) as #Name?. I don't understand why.Any help would be greatly appreciated.
Thank you.
I am trying to create a simple form in access project with a combo box and a list box that populates the values based on the value selected from the combo box.My VB code is as follows.
Dim Evar As String
With Me
fVisible = Not IsNull(.cbo) ----cbo is the combo box
.lstAssets.Visi ble = fVisible ----lstAssets is the listbox
If fVisible Then
Evar=.cbo.text -----I also tried SelText
strSQL = "EXECUTE sp_testbyvar " & Evar
.lstAssets.RowS ource = strSQL
.lstAssets.Requ ery
.lstAssets.Visi ble = True
End If
End With
For some reason, when i am trying to run the form, the list box is not generating the values.I realised that the variable Evar is reading the value form Me.cbo.text(or SelText) as #Name?. I don't understand why.Any help would be greatly appreciated.
Thank you.
Comment