W
Wind54Surfer
Hi again,
I am starting a new thread because the query turned out to be wrong.
Now i am getting the "data mismatch" error on the following part:
-------------------------------------------------------------------
build_sql = build_sql & "'" & _
DLookup("JobDate", "JobSchedule", "ScheduleID=""" & _
Schedule_ID & """") & "', "
-------------------------------------------------------------------
Tha complete query is:
------------------------------------------------------------------
Function build_sql(Schedule_ID As Date, operation As String) As String
build_sql = "Insert Into tblJobScheduleAuditLog Values ("
build_sql = build_sql & ScheduleID & ", "
build_sql = build_sql & "'" & _
DLookup("JobDate", "JobSchedule", "ScheduleID=""" & _
Schedule_ID & """") & "', "
build_sql = build_sql & "'" & _
DLookup("Scheduled", "JobSchedule", "ScheduleID=""" & _
Schedule_ID & """") & "', "
build_sql = build_sql & "'" & _
DLookup("Status", "JobSchedule", "ScheduleID=""" & _
Schedule_ID & """") & "', "
build_sql = build_sql & "'" & operation & "', "
build_sql = build_sql & "#" & Now() & "#)"
End Function
----------------------------------------------------------------------
In the table "tblJobScheduleAuditLog"
ScheduleID is Date/Time
Scheduled is Text
JobDate is Date/Time
Status is Text
I tried many things but I am stuck.
Thanks for any help,
Emilio
I am starting a new thread because the query turned out to be wrong.
Now i am getting the "data mismatch" error on the following part:
-------------------------------------------------------------------
build_sql = build_sql & "'" & _
DLookup("JobDate", "JobSchedule", "ScheduleID=""" & _
Schedule_ID & """") & "', "
-------------------------------------------------------------------
Tha complete query is:
------------------------------------------------------------------
Function build_sql(Schedule_ID As Date, operation As String) As String
build_sql = "Insert Into tblJobScheduleAuditLog Values ("
build_sql = build_sql & ScheduleID & ", "
build_sql = build_sql & "'" & _
DLookup("JobDate", "JobSchedule", "ScheduleID=""" & _
Schedule_ID & """") & "', "
build_sql = build_sql & "'" & _
DLookup("Scheduled", "JobSchedule", "ScheduleID=""" & _
Schedule_ID & """") & "', "
build_sql = build_sql & "'" & _
DLookup("Status", "JobSchedule", "ScheduleID=""" & _
Schedule_ID & """") & "', "
build_sql = build_sql & "'" & operation & "', "
build_sql = build_sql & "#" & Now() & "#)"
End Function
----------------------------------------------------------------------
In the table "tblJobScheduleAuditLog"
ScheduleID is Date/Time
Scheduled is Text
JobDate is Date/Time
Status is Text
I tried many things but I am stuck.
Thanks for any help,
Emilio