Commit record?

DAW

Registered User.
Local time
Yesterday, 17:04
Joined
Mar 22, 2006
Messages
70
I run the following code when the user executes a certain event (it records the time an email was sent):
Code:
SQL = "UPDATE tbl_RMAs SET [FourHour] = '" & Now() & "' WHERE [RMANo] = '" & Me.RMANo.Value & "';"
CurrentDb.Execute SQL
All is ok until I exit the form. I then get told that the record has changed by another user and would I like to discard or save etc. I'm sure I've used this before without such a message. All I want to do is overwrite whatever was the previous timestamp!
 
This is just a wild guess, but try this:

Code:
Dim SentTime As DateTime
SentTime=Now()
SQL= "UPDATE tblRMAs Set [FourHour] = '" & SentTime & '"...
 
This is just a wild guess, but try this:

Code:
Dim SentTime As DateTime
SentTime=Now()
SQL= "UPDATE tblRMAs Set [FourHour] = '" & SentTime & '"...

Thanks (again!) Banana, but updating the record isn't a problem. Its when I exit the form and get the message which I don't believe I should get.
 
Drats.

The reason why I suggested that was because I know that Access may requery the backend using the values it inserted and may have been expecting a different Now() value and thought it was edited when in fact it was yours.

One more thing- what if you directly edited the timestamp in the form? Do you get the message still?
 

Users who are viewing this thread

Back
Top Bottom