Use variable in select SQL field (1 Viewer)

amir0914

Registered User.
Local time
Today, 14:36
Joined
May 21, 2018
Messages
151
Hi all, is it possible to use variable instead of field name after where in select sql ??

pSQL = "select * from tbl_Data WHERE Type1 = '" & Me.Text0.Value & "' "


in the code i want to use variable instead of Type1 and I wrote it but it didn't work :

var = me.text2

pSQL = "select * from tbl_Data WHERE " & var & " = '" & Me.Text0.Value & "' "
 

Users who are viewing this thread

Top Bottom