Update Time records

M

Michael Lam

Hi All

I have designed a table which contain two date date columns and time columns
and two forms

All the date and time columns are contained in the same table.
Different portion of date ,time colums are accessed by two form (Request
Form and MIS Form)
Request Form is already automatically filled in time and date by define the
default value = Now()
and assigned autogen Ref No when create

The MIS Form will retrieve the record by Ref No
after create the event other suggested

"You'll need to use a line of VBA code in the Form's BeforeUpdate event
procedure, something like this:
Me.ViewDate.Value = Now() "

The MIS date , time portion of MIS form will be
filled in automatically
After I create several records, I try to retrieve the records in MIS form
and update it
The time record dont change

Any idea?
I have try to define those field not link to the table and default
value = Now()

So that the time and date shown on the MIS form will be exact the time
as computer clock
and create the follow event after update

Private Sub Date_AfterUpdate()
Dim rs As Object
rs = Me.Date.Value
rs = Now()

End Sub

It also dont work

any idea
 
W

Wayne Morgan

The form's BeforeUpdate event runs if there have been changes made to the
record but before those changes are saved to the table. If the user simply
views the record, no change has been made and your code in the BeforeUpdate
event doesn't run.

You will either need the reviewer to make some change or click a button to
indicate that they have seen the record and fill in the time in the button's
Click event. Another possibility would be to use the form's Current event to
fill in the time. The Current event will run every time you move to a
different record. If you do this, you'll also need to decide if you want to
update the date/time if there is already one there or if you only want the
date/time of the initial viewing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top