Insert Into Command

joe789

Registered User.
Local time
Today, 21:51
Joined
Mar 22, 2001
Messages
154
Hi Folks,

I have this code snippet that is suppossed to take a criteria passed from a text box on a form and insert the value into an already created table's field. For some reason, it isn't working. Any help would be greatly appreciated, the code snipet is pasted below. I should mention that the exact same code works perfectly for something else I am doing, so I am not sure if my syntax for the INSERT is wrong or what. When the code is ran, it does not generate any errors at all, it just doesn't work. The table is named ArchievedTables and the field that I want the value from the textbox to go into is named Tables.

Option Compare Database
Private Sub Command1_Click()


Dim SQL As String
Dim ABC As String

ABC = Text2

Set db = CurrentDb

SQL = "INSERT INTO [ArchievedTables] ([Tables])VALUES('" & ABC & "')"

End Sub

Any help is greatly appreciated,

Thank you,

Joe
 

Users who are viewing this thread

Back
Top Bottom