Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

time()

Status
Not open for further replies.

linda55

Technical User
Jun 22, 2001
19
0
0
US
I have the following code in the AfterUpdate event
Private Sub DecalNo_AfterUpdate()
If IsNumeric([DecalNo]) Then
Me!DecalDate = Forms!frmDecalDate!PaymentDate
Me!DecalType = "A"
Me!DecalAmt = 15
Me!Workstation = CurrentUser()
Me!time = time()
Else
Me!DecalDate = Null
Me!DecalType = Null
Me!DecalAmt = 0
Me!Workstation = Null
Me!time = Null

End If
I added the Workstation and time lines to existing code in the database that was developed by someone else. The Workstation line seems to work fine but I can't get the time to update to the current time for an existing record. If I enter a new record the time is updated. I want the time to be saved to the table from the form so that I can get a report of records saved during a certain period of time on a certain workstation. I would appreciate your help
 
This should work just fine. The problem may be your use of the keyword TIME as the field name. It's almost never a good idea to used keywords like DATE, TIME, NAME etc as field names.

? TIME() indeed does return the current clock time, as envisioned by the computer.

As long as the field is a Date/Time datatype, it should work just fine. But I'd change that field name.

Jim Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top