Full Version: Data Entry In Field (in Form) Updates A Date In Different Field
UtterAccess Forums > Microsoft® Access > Access Forms
Hi all
I have two fields (data entry is at the form level) that need to work together.
In other words
BAFrom field - user enters data in this field and automatically populates the current date Date() into the field named BAFromUpdated
I am going to assume it would be an AfterUpdate code - just wondering the best code for that.
Thanks so much!!!
That is your first name? <
You can accomplish this several ways.
1. At table level you can set the DefaultValue for the field to: Date()
2. In Form Design View-- you can set the Default Value of the Control to: Date()
3. In the AfterUpdateEvent of BAFrom
Me.BAFromUpdated = Date()
think you pretty much got it. For example:
Private Sub BAFrom_AfterUpdate()
BAFromUpdated = Date()
End Sub
Just my 2 cents... 2cents.gif
EDIT: Oops, didn't see Cynthia's post earlier. Sorry for the duplicate info.
Jerry Whittle
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty = True Then
Me.BAFromUpdated = Now()
End If
End Sub
The above will update the BAFromUpdated field if ANYTHING has been changed in that record. You might want to consideer using Now instead of Date as Now gives the date and time.
oing on my 'frig-- "typed faster than DB today!" <
Going on my monitor: "Take a break, Cynthia's got the ball." coffee1.gif
Thank you everyone!!!
will give it a try
DB & I were happy to help!
Good luck with your project!
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.