I tried and search around the web, but could not find an answer to it,
You see I am trying to insert 3 variables into the table, but seem like those " and ' cause the problem, No matter how I play with the ' and ", it still don;t work What wrong with the statement, could you please help.
Dim cust As String
Dim tel As String
Dim cont As String
cust = "Albert Longman"
tel = "1234567890 "
cont = "123456789"
Dim sqls As String
sqls = "insert into tblinvoice(cust omer, contact, telephone) values(' " & cust & " '," & cont & " ','" & tel & ")"
DoCmd.RunSQL strstmt
You see I am trying to insert 3 variables into the table, but seem like those " and ' cause the problem, No matter how I play with the ' and ", it still don;t work What wrong with the statement, could you please help.
Dim cust As String
Dim tel As String
Dim cont As String
cust = "Albert Longman"
tel = "1234567890 "
cont = "123456789"
Dim sqls As String
sqls = "insert into tblinvoice(cust omer, contact, telephone) values(' " & cust & " '," & cont & " ','" & tel & ")"
DoCmd.RunSQL strstmt
Comment