P
PayeDoc
Hello All
I have a function that returns a string value 'errorfield' (as well as some
other values), which can be over 1000 characters long.
After the function runs, this works fine:
DoCmd.RunSQL "INSERT into employee_submissions
(employee,submission_IRmark,submission_type )
Values([forms]![frm_p45_submission]![namee],""" & errorfield & """,""" &
subtype & """)"
but this does not:
MsgBox ("Was NOT successful, because of " & """ & errorfield & """)
The MsgBox action always results in the message:
Was NOT successful, because of " & errorfield & "
- irrespective of the value of 'errorfield.'
In case it made a difference, I have removed any quotes from 'errorfield'
with
errorfield = FindAndReplace([errorfield], """", "")
This succeeds in removing any quotes, but I still get the problem above.
I can't understand why
""" & errorfield & """
is OK in the DoCmd.RunSQL "INSERT statement, but not in the MsgBox action.
Hope someone can help.
Many thanks
Leslie Isaacs
I have a function that returns a string value 'errorfield' (as well as some
other values), which can be over 1000 characters long.
After the function runs, this works fine:
DoCmd.RunSQL "INSERT into employee_submissions
(employee,submission_IRmark,submission_type )
Values([forms]![frm_p45_submission]![namee],""" & errorfield & """,""" &
subtype & """)"
but this does not:
MsgBox ("Was NOT successful, because of " & """ & errorfield & """)
The MsgBox action always results in the message:
Was NOT successful, because of " & errorfield & "
- irrespective of the value of 'errorfield.'
In case it made a difference, I have removed any quotes from 'errorfield'
with
errorfield = FindAndReplace([errorfield], """", "")
This succeeds in removing any quotes, but I still get the problem above.
I can't understand why
""" & errorfield & """
is OK in the DoCmd.RunSQL "INSERT statement, but not in the MsgBox action.
Hope someone can help.
Many thanks
Leslie Isaacs