Parameter Value Popup Error

I keep getting this popup when I run the form asking me to enter the parameter value for the field. Attached is a screenshot of the pop-up and the setting for the textBox.
Dim arName As String
Dim enName As String
Dim box As String
Dim landl As String
Dim mob As String
 
Text1.SetFocus
arName = Text1.Text
 
Text3.SetFocus
enName = Text3.Text
 
DoCmd.RunSQL "INSERT INTO Owner(NameAr, NameEn) VALUES (" & arName & ", " & enName & ");"

Open in new window

ScreenHunter-01-Jul.-08-11.01.jpg
ScreenHunter-02-Jul.-08-11.02.jpg
ScreenHunter-03-Jul.-08-11.02.jpg
ScreenHunter-04-Jul.-08-11.02.jpg
MariamAlsowaidiAsked:
Who is Participating?
 
tbsgadiCommented:
RunSQL "INSERT INTO Owner(NameAr, NameEn) VALUES ("" & arName & "", "" & enName & "");"
0
 
MariamAlsowaidiAuthor Commented:
Thanks, that worked
But for the future, why does that happen?
0
 
hnasrCommented:
Look for ArabicName in your code.  Check if it is entered as a criteria or an unknown field in a query.
0
 
tbsgadiCommented:
If you have strings as opposed to numbers you need to double up the quotations.
0
 
NicolazeCommented:
Replace your last code line with the following - You can copy / paste: (That will have the effect of surrounding arName and enName by a single quote)

DoCmd.RunSQL "INSERT INTO Owner(NameAr, NameEn) VALUES ('" & arName & "', '" & enName & "');"
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.