I'm trying to create a sql statement but I require the use of a VB variable. The problem is, I keep getting an error about too few parameters when I try to just put the variable in. Is there some sort of format I need to use in order to add a VB variable into a SQL statement?
Set rs = CurrentDb.OpenRecordset("SELECT StartTime " & _
"FROM tblLunchTime " & _
"WHERE TimeID = (SELECT max(TimeID-count) FROM tblLunchTime);")
The variable in this situation is 'count'.