dbSeeChanges Question

gmatriix

Registered User.
Local time
Today, 10:53
Joined
Mar 19, 2007
Messages
365
Hello All,

I have this code below. I am trying to figure out where to put the "dbSeeChanges" portion of it so it will update my SQL db. I have tried different places in the code and I get type mismatch, which I understand.

Any Ideas?

Thanks
Code:
Private Sub Form_AfterUpdate()
Dim dd As Date
    Dim dbs As DAO.Database
    Set dbs = CurrentDb
    Dim pID As Integer
    Dim sHostName As String
    Dim sUserName As String
    Dim cmd As String
    pID = [productid].Value 
    dd = Format(Now(), "dd/mm/yyyy hh:mm:ss")
    ' Get Host Name / Get Computer Name
    sHostName = Environ("computername")
    ' Get Current User Name
    sUserName = Environ("username")        'Username is obtained to produce Time and UserStamp
    cmd = "UPDATE Product SET DateStamp=#" & dd & "#, UserStamp='" & sUserName & "' WHERE [productID]=" & pID & ""
    dbs.Execute cmd
End Sub
 
Is the above code not working? What is the problem again, a bit unclear..

EDIT: Okay, just add dbs.Execute cmd, dbSeeChanges

Think that is it..
 
Last edited:
Hello,

Sorry the code above is working fine when it is just in access however, I have it linked to a table in SQL now. Now I get an error telling me I need to use the "dbSeeChanges" option.

I just need to know where to put it so it work on the linked table form SQL.

Thanks
 
Sorry I edited the answer after replying to it.. I think it goes along with the execute command..

dbs.Execute(cmd,dbSeeChanges)
 
Thanks Again,

I appreciate the help. This works great!

You are the man!
 

Users who are viewing this thread

Back
Top Bottom