Jun 6, 2007 #1 dmon000 Technical User Sep 9, 2003 79 US How can you get a VB variable value as the criterion in a query?
Jun 6, 2007 #2 orna Programmer Apr 2, 2002 314 IL In the criteria call a function that returns the variable. Upvote 0 Downvote
Jun 6, 2007 1 #3 jadoogar Programmer Oct 23, 2003 61 IN You construct a string in which the query you want to pass to SQL/Access like this command = "insert into village_facilities values ('" & mdate & "','" & x2 & "','" & x3 & "','" & x4 & "')" where x1, x2 are values to be passed '" & varname & "' will pass a non numeric value where as " & varname & " will pass a numeric value to execute the query use conn.execute command where conn has to be defined to the database. Upvote 0 Downvote
You construct a string in which the query you want to pass to SQL/Access like this command = "insert into village_facilities values ('" & mdate & "','" & x2 & "','" & x3 & "','" & x4 & "')" where x1, x2 are values to be passed '" & varname & "' will pass a non numeric value where as " & varname & " will pass a numeric value to execute the query use conn.execute command where conn has to be defined to the database.