Question : docmd.runsql insert into question

This is my error:
You can't reference a property or method for a control unless the control has the focus.

This is my code:
DoCmd.RunSQL "INSERT INTO tblCompanyName (CompanyName,Address1,Address2,Address3,PostalCode,Country) " & _
"VALUES (" & txtCompanyName & "," & txtAddress1 & "," & txtAddress2 & "," & txtAddress3 & "," & txtPostalCode & "," & txtCountry.Text & ");"

what am i doing wrong?

Answer : docmd.runsql insert into question

Check to see if Allow zero length is set to true on all the text fields.
Random Solutions  
 
programming4us programming4us