My INSERT works fine but my UPDATE doesn't .... I'm not sure if I can have two SQL executions here or if I need to create a separate function for this ...or maybe my syntax is just wrong.
Thanks in advance
Thanks in advance
Code:
'The below script sends the data to the Patient Schedule function Send_to_EventsPT_Table as c (e as p) dim cn as sql::connection cn.Open("::Name::SQL") 'saved connection string dim args as sql::arguments args.set("arg1",e._currentRowDataNew.StartTime) args.set("arg2",e._currentRowDataNew.EndTime) args.set("arg3",e._currentRowDataNew.StaffName) args.set("arg4",e._currentRowDataNew.Staff_Specialty) args.set("arg5",e._currentRowDataNew.Patient_ID_Num) args.set("arg6",e._currentRowDataNew.ClientID) args.set("arg7",e._currentRowDataNew.DateTimeCreated) args.set("arg8",e._currentRowDataNew.TypeOfVisit) args.set("arg9",1) args.set("arg10",0) args.set("arg11",e._currentRowDataNew.ID) cn.Execute("INSERT INTO EventsPT (STARTTIME, ENDTIME, EVENTNAME, Field1, GroupID, clientid, Notes, Field6) VALUES (:arg1, :arg2, :arg3, :arg4, :arg5, :arg6, :arg7, :arg8)",args) cn.Execute("UPDATE QANursingForms SET QAPending = :arg10, QAComplete = :arg9, WHERE NursingFormID = :arg11" ) cn.close() 'The below script hides the "Send to Patient Schedule" button and completes QA when it is pressed e._set.HideButton.value = "1" e._set.QA_Complete.value = "1" e._set.QA_Pending.value = "0" end function
Comment