Monday, 15 March 2010

sql - Where clause in VBA statement -



sql - Where clause in VBA statement -

i having problem vba,

i have next lines vid & txtapp both fields filled in on form , statment should run after txtapp updated.

ssql = "select vid, app_date, app_time" ssql = ssql & " qry_subform" ssql = ssql & " vid = " & me.vid & "and app_date = #" & me.txtapp & "#" set ors = currentdb.openrecordset(ssql)

but doesn't seem passing date field query, not sure wrong it. help greatfully excepted driving me mad.

add space before and in 3rd line otherwise may getting syntax error

ssql = ssql & " vid = " & me.vid & " , app_date = #" & me.txtapp & "#" not ssql = ssql & " vid = " & me.vid & "and app_date = #" & me.txtapp & "#"

you debug adding line debug.print ssql after have built query, or using watch on ssql , eyeballing string have built.

sql vba

No comments:

Post a Comment