Issues with VBA, accessDB and time date (1 Viewer)

245

New member
Local time
Yesterday, 19:10
Joined
Jul 25, 2010
Messages
8
Access_2007

Short (kind-of) and bitter ...
Separate forms that pretty-much use the same code. One forms' date field exhibits absolutely no problems while the other forms' date field intermittently does the following:
After using the date picker ...

Private Sub DONE_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Requery
End Sub

Private Sub RECORD_ENTERED_AfterUpdate()
Me!RECORD_ENTERED = Now()
End Sub
======= Later we thought and changed the above to:

Private Sub DATE_ENT_AfterUpdate()
Me!DATE_ENT = Now()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Requery
End Sub
=== Initially thinking the problem was solved; not so. The change between the two (2) above examples occurred on 1/7/2012 1:09:00 AM. Today @ 1/10/2012 1:05:50 PM the concern returned whereby after using the date picker the code, or Access, refuses to properly initiate the "Now()" and just leaves the date in the field without the time.

The other table we have does not offer us this problem. This appears to be such a simple task. A deeper concern is both fields using separate forms and, separate tables, have the same data types, yet, only one (1) appears to work flawlessly.

Fields have different names both within the table and the forms. There is no relationship between the two (2). The temp fix we used today (1/10/2012 1:05:50 PM) was to close and reopen the database. We received a little something extra for our troubles. Not only did the concern appear to resolve itself, but Access put the time in the proper field but for the previous record which happened to be on the previous day/date.

We tried three time in succession to run the code and it refused to work properly; not placing the time using the code shown above until we closed and reopened the database.

Hope we explained this clear enough.
 

Users who are viewing this thread

Top Bottom