edgarchado
Technical User
Hi to all,
I have two como boxes. The first combo box which it's source is a list with two values (1 and 2) determines what information will show up in the second combo box.
I am using this code in the afterupdate event of the fist combo box to acomplish this:
Private Sub Formato_AfterUpdate()
Me.Sensibilidad.RowSource = "SELECT sensibilidad FROM" & _
" Productos WHERE formato = " & Me.Formato
Me.Sensibilidad = Me.Sensibilidad.ItemData(0)
End Sub
The problem that I am having is with the & Me.Formato portion of the code.
When selecting the first combo box. The source data of the second box turns into (when selecting 1 in the first):
SELECT sensibilidad FROM Productos WHERE formato = 1
The problem is that for the select to work I need the 1 to be between Quotation Marks ("1").
How can I add this in the & Me.Formato section of the first combo so that they apear in the second one.
I hope my question is clear.
Thank you.
I have two como boxes. The first combo box which it's source is a list with two values (1 and 2) determines what information will show up in the second combo box.
I am using this code in the afterupdate event of the fist combo box to acomplish this:
Private Sub Formato_AfterUpdate()
Me.Sensibilidad.RowSource = "SELECT sensibilidad FROM" & _
" Productos WHERE formato = " & Me.Formato
Me.Sensibilidad = Me.Sensibilidad.ItemData(0)
End Sub
The problem that I am having is with the & Me.Formato portion of the code.
When selecting the first combo box. The source data of the second box turns into (when selecting 1 in the first):
SELECT sensibilidad FROM Productos WHERE formato = 1
The problem is that for the select to work I need the 1 to be between Quotation Marks ("1").
How can I add this in the & Me.Formato section of the first combo so that they apear in the second one.
I hope my question is clear.
Thank you.