
How to insert record into table
Always put your variables in Quotes.
rs.Open "INSERT INTO myTestTable (FirstName) VALUES ('" & NameField & "')"
Just copy the above line to your code, otherwise you might left the quotes.
Please note, there is a Single Quote after ( bracket and before ) bracket.
Best Regards,
Luqman
Quote:
> How can I insert the name input by the user into the table
> My segment code is as below:
> NameField = txtName.Text
> rs.Open "INSERT INTO myTestTable (FirstName) VALUES (NameField)"
> the NameField is inserted instead of the user input name.
> thanks
> sllai