none
VBA code for quick serching files in list isn't working in Access RRS feed

  • Question

  • Hi I currently have a table called Equipment_List with data that is in text format,  the information usually looks like TE-1325, TE-98745 etc. I wrote some VBA code for a report with drop down box in a sub report when I select a TE-### I'm wanting access to quickly show me the selected file associated to TE-### from Equipment_List table in my sub report. It is currently working for other text fields in Equipment_List table well just not this one. I'm thinking it's due to the mixture of numbers and text in this field. Can anyone look at my code and see if there is a reason it wouldn't work for my current situation.

    Private Sub Control_Search_AfterUpdate()
    Dim Control_list As String
    Control_list = "Select * from Equipment_List where (Control = '" & Me.Control_search & "')"
    Me.Equipment_List_subform.Form.RecordSource = Control_list
    Me.Equipment_List_subform.Form.Requery
    End Sub

    Saturday, February 2, 2019 4:16 AM