Hi all,
I am having a problem with a memo field and a string var,
------------------------------------------------------
this is the code:
Sub writef(OrgValue as string, Curvalue as String)
Dim fsql as String
fsql = "INSERT INTO AuditTable Values("'" & OrgValue & "', '" & CurValue & "')"
CurrentDb.Execute fsql
--------------------------------------------------------
Orgvalue and CurValue are 2 string vars that containts free text to be save in 2 memo fields.
the above code works as long as i dont include ' or " in vars OrgValue or CurValue, otherwise i got a Syntax error message
If these 2 vars are free text How can i prevent from happening this error, The only way i see is letting users know they are not allowed to enter (') or (").
I am having a problem with a memo field and a string var,
------------------------------------------------------
this is the code:
Sub writef(OrgValue as string, Curvalue as String)
Dim fsql as String
fsql = "INSERT INTO AuditTable Values("'" & OrgValue & "', '" & CurValue & "')"
CurrentDb.Execute fsql
--------------------------------------------------------
Orgvalue and CurValue are 2 string vars that containts free text to be save in 2 memo fields.
the above code works as long as i dont include ' or " in vars OrgValue or CurValue, otherwise i got a Syntax error message
If these 2 vars are free text How can i prevent from happening this error, The only way i see is letting users know they are not allowed to enter (') or (").