access2010
Registered User.
- Local time
- Today, 02:18
- Joined
- Dec 26, 2009
- Messages
- 1,021
Hi Nicole. Have you tried using the Form's BeforeUpdate event? Just curious...
You may also want to try the forms Dirty event. This happens prior to leaving the record.
Majp, thank you for your suggestion, which does not work the way we would like.In either case your code would be
ResearchDate = Date()
Pick one of the events. Click on the ellipses to create the event procedure. Add the code
Did you already try the Form's BeforeUpdate event?Majp, thank you for your suggestion, which does not work the way we would like.
This is the code in the date field
Private Sub ResearchDate_LostFocus()
Me.ResearchDate = Date
End Sub
The above code works when the cursor leaves the date field, but I would like to have the DATE updated when the cursor leaves any of the fields.
Do you have a suggestion on how to this?
Crystal
You will have to explain that because that is the only code that would do what you are saying, unless you are not being clear. This and the before update will do the same thing. The difference is the dirty event will happen without having to leave the record, the before update will do it when you leave the record.Majp, thank you for your suggestion, which does not work the way we would like.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.ResearchDate = Date
End Sub
Well, in @MajP 's defense, technically, there wouldn't be any problem. Because if "without making a change" ends up being the case, then the ResearchDate won't be updated either..Using the LostFocus event of a Control will update the Record...even if you simply move thru the Control...without making any change!
Hi Crystal. Glad to hear you got it sorted out. Good luck with your project.Thank you ALL for your suggestions.
I had placed the suggested code in the wrong place and now that the code is in the = BeforeUpdate event = we receive the results wanted.
Crystal