How can I retain data in afeld from previous record

  • Thread starter Thread starter Flyer
  • Start date Start date
F

Flyer

Guest
Hi,
Hope somebody can help, I am new to this forum and to access.
I have written a small database to record employee hours.
When inputting data from a form I would like to be able to leave the date and the employees name the same from one record to the next and just tab through them untill I get to a new employee or a different date. How can I do it but still enter the hours worked on that record.

The form is based on a single table which has the date the job the employee and the different hours an employee has worked on that jobs. Jobs are seperate table as is employee records.

Many thanks

Dave
 
This is a bit of code I stored away once:

Making the next field in records default to the last record.

Lets work with the UserID field for an example:

In the After Update event of the UserID field put code like this:
Me![UserID].Tag = Me![UserID].Value

In the On Enter Event of the same field put code like this:
If Not Me.NewRecord Then Exit Sub
If Not (IsNull(Me![UserID].Tag) Or Me![UserID].Tag = "") Then
Me![UserID].Value = Me![UserId].Tag
End If

The UserID will not carry over into your next session with the form but will work as long as the form is open....

Just subsitute the code into each field you require to carry over

HTH
Dave
 

Users who are viewing this thread

Back
Top Bottom