For example we have an event such as:
Function BeforeEdit(dict, where)
' Parameters:
' dict - Scripting.Dictionary object.
' Each field on the Edit form represented as 'Field name'-'Field value' pair
' where - string with WHERE clause pointing to record to be edited
dict("Last Modified") = strUserID & " - " & Now()
dict("CSR") = strUserID
dict("Status") = "2"
dict("Resolution Date") = Now()
'** Save new data in another table ****
strSQLSave = "INSERT INTO [CSR Records] (Project, Sims, ProblemDescription, Technician, [Tech Support], Priority, Severity, TechSuppRegion, ExtraDetail, SYSType) values ("
strSQLSave = strSQLSave & "'" & cstr(dict("Project")) & "', '"
strSQLSave = strSQLSave & cstr(dict("Sims")) & "', '"
strSQLSave = strSQLSave & "Referral - " & dict("ProblemDescription") & "', "
strSQLSave = strSQLSave & dict("Technician") & ", '"
strSQLSave = strSQLSave & dict("CSR") & "', '"
strSQLSave = strSQLSave & dict("Priority") & "', '"
strSQLSave = strSQLSave & dict("Severity") & "', '"
strSQLSave = strSQLSave & dict("TechSuppRegion") & "', '"
strSQLSave = strSQLSave & dict("ExtraDetail") & "', '"
strSQLSave = strSQLSave & "Referral"
strSQLSave = strSQLSave & "')"
dbConnection.Execute strSQLSave
BeforeEdit = True
' set BeforeEdit to True if you like to proceed with editing this record
' set it to False in other case
End Function
- ExtraDetail field has a value of "Joe's garage" - the above event stops with error at 's'
- I haven't tried anything yet but I'd assume something like a REPLACE on the string would be in order here?
- Something like:
EDFix = Replace(dict("ExtraDetail") , "'", "")