The following code uses the transaction date & time. I want it to use the current system date & time instead. How do I do that.
Private Sub Supervised_By_AfterUpdate()
Me.SupPurDate = Date
Me.SupPurEntryTime = Time
Me.Requery
End Sub
The following code uses the transaction date & time. I want it to use the current system date & time instead. How do I do that.
Private Sub Supervised_By_AfterUpdate()
Me.SupPurDate = Date
Me.SupPurEntryTime = Time
Me.Requery
End Sub
These would be the default values.Me.SupPurDate = Date()
Me.SupPurEntryTime = Time()
HTH
It sounds like you've got fields named date and time, which isn't a good idea. You may need to be explicit:
VBA.Date
Your code is kinda complex. You might want to delegate a separate function for time and date then try to simplify it from there.
@Accedeholdings, why would do you say the code is complex? Don't think it can get much simpler.
As Paul said, Date and Time are reserved words and should not use reserved words as field names. Maybe VBA was pulling from the fields but there are times that reserved word field names could cause unexpected results.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
VBA.Date
VBA.Time
Worked Thx
No problem.