Garcimat
Member
- Local time
- Today, 18:59
- Joined
- Jun 7, 2022
- Messages
- 67
Hi guys
how do I call a variable inside a sql query ? I can do it on the sql server but no with access.
I want to use the value from a combo box as filter, actually several combos
Dim sql As String
Dim varCMB As Variant ' value from the combo box
varCMB = Me.cmbSection
sql = "SELECT* FROM tblData WHERE Section = varCMB"
Thanks in advance
how do I call a variable inside a sql query ? I can do it on the sql server but no with access.
I want to use the value from a combo box as filter, actually several combos

Dim sql As String
Dim varCMB As Variant ' value from the combo box
varCMB = Me.cmbSection
sql = "SELECT* FROM tblData WHERE Section = varCMB"
Thanks in advance