Data Entry/New Record question

E

E

I have an MS Access 2000 application I'm putting together for a lab where I
work. In the application the user will record 40 different lab values. They
will be entreing lab values mulitple times. The values may or not change
each time they enter the lab values. The user, would like the last lab
values entered to appear on the form and they will make any adjustments
before saving the record so they don't have to enter 40 values each time. I
can set forms data source to the last record in the set, however, when i go
to add the new record it just changes to old record. I've tried changing the
form's data entry property to true but that just eliminates the values. Is
there a way to do this without opening a recordset and assigning the values
in the last record to the data entry fields in the form?

Sorry for the long post. I hope I was clear.
 
K

Klatuu

There is a fairly simple way to do that.
In the After Update event of each control you want to carry the value
forward, set it's DefaultValue property to the value of the control:

Private Sub SomeControl_AfterUpdate()
Me.SomeControl.DefaultValue = Me.SomeControl
End Sub

Now, when you add a new record, it will be populated with the value of the
controls Default Value. You will not see the value until you enter a
character in a control on the form. That would be one of the controls that
changes for each record. The default value will presist until either you
change the value in the control or you close the form.
 
E

E

Thanks, that seems to do the trick.

Klatuu said:
There is a fairly simple way to do that.
In the After Update event of each control you want to carry the value
forward, set it's DefaultValue property to the value of the control:

Private Sub SomeControl_AfterUpdate()
Me.SomeControl.DefaultValue = Me.SomeControl
End Sub

Now, when you add a new record, it will be populated with the value of the
controls Default Value. You will not see the value until you enter a
character in a control on the form. That would be one of the controls that
changes for each record. The default value will presist until either you
change the value in the control or you close the form.
 

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