Access Project-Problem with VB code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TheIntern
    New Member
    • Oct 2006
    • 4

    #1

    Access Project-Problem with VB code

    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.
  • TheIntern
    New Member
    • Oct 2006
    • 4

    #2
    Well, I changed the code a little bit and now the value from the combo box is read properly.But still the list box is still not populating any values.Could somebody tell what could possible be wrong.

    Comment

    Working...