The following code works fine, except when the string called "Explanation" is an especially large string. The line of code in red throws an error when the string is long (probably over 255 chars I'm guessing). The error throws BEFORE I run the query - it throws when I set the parameter value (see the red line). The database column is type "Memo."
Dim qdef As QueryDef
Set qdef = CurrentDb.CreateQueryDef("")
qdef.SQL = "INSERT INTO Ncodes (Code, Explanation) VALUES (@Code, @Explanation)"
qdef.Parameters("@Code").Value = txtCode
qdef.Parameters("@Explanation").Value = txtExplanation.Value
qdef.Execute
What's the easiest way to modify this code as to make it accept long strings?
Dim qdef As QueryDef
Set qdef = CurrentDb.CreateQueryDef("")
qdef.SQL = "INSERT INTO Ncodes (Code, Explanation) VALUES (@Code, @Explanation)"
qdef.Parameters("@Code").Value = txtCode
qdef.Parameters("@Explanation").Value = txtExplanation.Value
qdef.Execute
What's the easiest way to modify this code as to make it accept long strings?