Default response in a new control based on a prior control's respo

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a data entry form (bound to a table). The form permits data entry on
sucessive days - day one, then day two, etc.

I want to default the reponse from day one into day two, while still
permitting the user to change day two's data if needed.

Despite many web searches, and checking every Access book I have, I've been
unable to find out how to do this. (Access 2003)

I appreciate any help you can give me!

Melissa
 
Hi, Melissa.

Navigate to the correct record, read the current values into an array, move
to a new record, and assign the controls.

In the On Open form event:

Dim arrMyRecord(3) As Variant
DoCmd.GoToRecord , "YourForm", acLast
arrMyRecord(1) = Me!Field1
arrMyRecord(2) = Me!Field2
arrMyRecord(3) = Me!Field3
DoCmd.GoToRecord , "YourForm", acNewRec
Me!Field1 = arrMyRecord(1)
Me!Field2 = arrMyRecord(2)
Me!Field3 = arrMyRecord(3)

Alternatively, you could navigate to the record using a Where clause with
the OpenForm method.

Hope that helps.
Sprinks
 
I have a form that show the response and permits data entry on them for a
patient...day one, day two, day three, etc.

On day one, the nurse selects 'general diet' from the 'Diet' combo box list.

I want to populate the day two 'Diet' question (different field name in the
table, different control on the form) with the 'general diet' response from
the day one control.

Is that clearer?

Thanks for thinking about this!

Melissa
 
Back
Top