i am sure that i am missing something simple. i have viewed pbaldy's thread, http://www.access-programmers.co.uk/forums/showthread.php?t=205231 and http://www.baldyweb.com/wherecondition.htm but my code still is not outputting what i expect.
my function is;
when i run the function, a prompt box asks for cldatDate rather then getting the date from Forms!frmCheckIn.txtDate. what am i missing?
my function is;
Code:
Function ckIn()
Dim dbs As Database
Set dbs = CurrentDb()
dbs.Execute "INSERT INTO tblClinicData (clstrNameInd,clstrSSN,clstrLocation,cldatTimeIn,cldatDate,clstrPHA, " & _
"clstrHIV,clstrOver40lab,clstrFlu,clstrHep,clstrTdap, " & _
"clstrProfileReview,clstrOther,clstrRemarks,clstrCell)" & _
"VALUES ('" & Forms!frmCheckIn.cboSoldierName.Column(0) & "', '" & Forms!frmCheckIn.cboSoldierName.Column(1) & "'," & _
"'" & Forms!frmCheckIn.txtclstrLocation & "','" & Format(Time(), "hh:mm") & "','" & Format(Date, "yyyy-mm-dd") & "'," & _
"'" & Forms!frmCheckIn.ckclstrPHA & "', '" & Forms!frmCheckIn.ckclstrHIV & "', '" & Forms!frmCheckIn.ckclstrOver40lab & "'," & _
"'" & Forms!frmCheckIn.ckclstrFlu & "','" & Forms!frmCheckIn.ckclstrHep & "','" & Forms!frmCheckIn.ckclstrTdap & "'," & _
"'" & Forms!frmCheckIn.ckclstrProfileReview & "','" & Forms!frmCheckIn.ckclstrOther & "'," & _
"'" & Forms!frmCheckIn.txtclstrRemarks & "','" & Forms!frmCheckIn.txtclstrCell & "')"
If Forms!frmCheckIn.ckclstrPHA = True Or Forms!frmCheckIn.ckclstrOver40lab = True Then
DoCmd.OpenReport "rptPha", acViewPreview, , "cldatDate = #" & Forms!frmCheckIn.txtDate & "#", acNormal
End If
DoCmd.Close acForm, "frmCheckIn"
End Function