ms access - error with multiple dlookup criteria -
this code produces runtime error 3464 dlookup
matchstr_t
. can't understand why matchstr_v
seems work fine. offers? @ moment i'm trying use dlookup
flag duplicate start times appointments.
dim i, j, clientid, therid integer dim origin_date, apptdate date dim slotday, apptype, venue, matchstr_v, matchstr_t string dim slottime date dim appt(25) date dim db database dim rst recordset dim test variant origin_date = date slotday = me.slot_day.value slottime = me.slot_time.value clientid = me.client_id.value therid = me.therapist_id.value venue = me.venue.value apptype = "continuation" slottime = format(slottime, "short time") = 1 7 apptdate = date + if weekday(apptdate, 2) = slotday 'set stuff j = 0 25 appt(j) = apptdate + (j * 7) set db = currentdb() set rst = db.openrecordset("dummy") debug.print "[therapist id] = " & therid matchstr_v = "[appt date]= #" & appt(j) & "# , [appt time] = #" & slottime & "# , [venue] = '" & venue & "'" matchstr_t = "[appt date]= #" & appt(j) & "# , [appt time] = #" & slottime & "# , [therapist id] = " & therid debug.print matchstr_t if not isnull(dlookup("[dummy id]", "dummy", matchstr_v)) ' more stuff elseif not isnull(dlookup("[dummy id]", "dummy", matchstr_t)) ' more stuff else rst.addnew rst.fields("appt date") = appt(j) rst.fields("appt time") = slottime rst.fields("client id") = clientid rst.fields("therapist id") = therid rst.fields("appt type") = "continuation" rst.fields("attendance") = "scheduled" rst.fields("venue") = venue 'debug.print rst.fields("appt date") rst.update test = (dlookup("[dummy id]", "dummy", matchstr_v)) debug.print test end if rst.close db.close next j else end if next
what datatype of [therapist id]?
there seems datatype mismatch value of therid.
Comments
Post a Comment