Hello All,
I have a questions. This code was working fine but, when I added more data to the table it would error "saying overflow" so I changed
Dim pID As Interger to
Dim pID as Long
Now it is saying "Too few parameters. Expected 1. Its has an error on the line that says "dbs.Execute cmd, dbSeeChanges"
Not sure what this means.
Here is the code.
Any Ideas??
I have a questions. This code was working fine but, when I added more data to the table it would error "saying overflow" so I changed
Dim pID As Interger to
Dim pID as Long
Now it is saying "Too few parameters. Expected 1. Its has an error on the line that says "dbs.Execute cmd, dbSeeChanges"
Not sure what this means.
Here is the code.
Code:
Private Sub Form_AfterUpdate()
Dim dd As Date
Dim dbs As DAO.Database
Set dbs = CurrentDb
Dim pID As Long
Dim sHostName As String
Dim sUserName As String
Dim cmd As String
pID = [product id].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, dbSeeChanges
End Sub
Any Ideas??
Last edited: