F
Find a Ritz guy
Hi, I am trying to do something I know is simple, but I'm just not getting it
right. I'd like to INSERT (create) a new record into my Transaction table and
insert the users UserID when they click a button. Can someone please tell me
what I'm doing wrong with this code? Thanks for any help!
Dim strSQL As String, strQuote As String, strUserID As String
strQuote = "'"
strUserID = Environ("username")
strSQL = "INSERT INTO [tblTransaction] (UserID) "
strSQL = strSQL & "VALUES (" & strQuote & strUserID & strQuote & ")"
DoCmd.SetWarnings (WarningsOff)
DoCmd.RunSQL strSQL
right. I'd like to INSERT (create) a new record into my Transaction table and
insert the users UserID when they click a button. Can someone please tell me
what I'm doing wrong with this code? Thanks for any help!
Dim strSQL As String, strQuote As String, strUserID As String
strQuote = "'"
strUserID = Environ("username")
strSQL = "INSERT INTO [tblTransaction] (UserID) "
strSQL = strSQL & "VALUES (" & strQuote & strUserID & strQuote & ")"
DoCmd.SetWarnings (WarningsOff)
DoCmd.RunSQL strSQL