Hi ! I'm new in VBA and Access. I'm trying to create a Equipment database. I want to filter the search based on a search box, a combo box and an option group box. I already build the search box and the option group box for one parameter. However, when I try to create either a combo box or an option group to a numeric parameter I get an error message saying that I have a syntax error on the FROM clause. Is there anyone who can help me?
The code that I'm using to the combo box is the following :
Private Sub cc_deq_combo_box_AfterUpdate()
Dim cc_deq As String
cc_deq = "SELECT LISTA_EQ.ID, LISTA_EQ.[No INV], LISTA_EQ.DESCRICAO, LISTA_EQ.MARCA, LISTA_EQ.MODELO, LISTA_EQ.[Num_SERIE / MATRICULA] " _
& "FROM LISTA_EQ" _
& "WHERE ([CC_DEQ] = " & Me.cc_deq_combo_box & ")" _
& "ORDER BY [No INV]"
Me.subInfoResults.Form.RecordSource = cc_deq
Me.subInfoResults.Form.Requery
End Sub
Thanks,
Argel
The code that I'm using to the combo box is the following :
Private Sub cc_deq_combo_box_AfterUpdate()
Dim cc_deq As String
cc_deq = "SELECT LISTA_EQ.ID, LISTA_EQ.[No INV], LISTA_EQ.DESCRICAO, LISTA_EQ.MARCA, LISTA_EQ.MODELO, LISTA_EQ.[Num_SERIE / MATRICULA] " _
& "FROM LISTA_EQ" _
& "WHERE ([CC_DEQ] = " & Me.cc_deq_combo_box & ")" _
& "ORDER BY [No INV]"
Me.subInfoResults.Form.RecordSource = cc_deq
Me.subInfoResults.Form.Requery
End Sub
Thanks,
Argel