-
Having trouble with moving text to table
I am trying to store the name of a table in another table to be able to access it later with a combo box. I am storing it in "TableNames" in the column "Table Name". I am trying to store values from an unbound text box "tablename" on the form "MainForm"
This is the code i am using
CurrentDb.Execute "INSERT INTO TableNames (Table Name) Values(" & MainForm.tablename & ")"
Any help is appreciated
Thanks
Last edited by geoffwbailey; 06-17-2010 at 09:38 AM.
-
If it's a text value, it needs to be surrounded by single quotes (just inside each of the parentheses). Also, I think the form reference is off:
Forms Refer to Form and Subform properties and controls
If there is really a space in your field name, it would need to be bracketed.
-
it worked
That worked. Thanks a lot
-
No problemo; welcome to the site by the way!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules