Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax Question

Status
Not open for further replies.

rjoshi2

Programmer
Sep 10, 2002
110
US
What is wrong with my insert syntax? My code is running fine not giving me an error. The problem is the code is not actually inserting the CurrentUser into the table. The code seems to be running fine all three message boxes are popping up. Any help would be appreciated.

Thank You,
rjoshi2

My code:

Private Sub OCB_AfterUpdate()
Dim insertID As String
MsgBox ("User ID: " & CurrentUser)

insertID = "INSERT INTO FY03COMREG( [User ID] ) " & _
"VALUES('" & CurrentUser & "') ;"

MsgBox ("User ID: " & CurrentUser)
CurrentDb.Execute insertID
MsgBox ("User ID: " & CurrentUser)
End Sub
 
docmd.runsql "INSERT INTO FYO3COMREG ([user id]) VALUES ('" & currentuser & "')"

Christiaan Baes
Belgium
"What a wonderfull world" - Louis armstrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top