Share via

Microsoft Access: autofill fields in data entry form based on the answer to a single field

Anonymous
2022-12-12T14:35:55+00:00

I have created a data entry form, howver I would now like to ammend this to make it more user friendly. If the answer is "no" to the first field the answer will always be the same for other fields therefore I would like it to autopopulate these fields to avoid the risk of data-entry error.

Is this possible?

I would really appreciate any help

Katie

Microsoft 365 and Office | Access | For education | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

10 answers

Sort by: Most helpful
  1. George Hepworth 22,855 Reputation points Volunteer Moderator
    2022-12-12T15:36:02+00:00

    As noted, the three following fields are dependent -- at least in part -- on the value of the initial field, which is an inappropriate design for a relational database application, at least in theory. Some might insist that it's never appropriate. However, in this case, you have to have values for those three fields regardless of the selection in the initial level of care. I'm going to have to think about this one for a bit, to be honest, because I can see it both ways. Let's get some additional input as well.

    It's possible to use the AfterUpdate event of the initial ComboBox that selects level of care to assign default values to the other three fields. That's pretty basic coding. Nonetheless, it may not be the most appropriate approach.

    BTW: I STRONGLY urge you to clean up the field names. Long, wordy field names are hard to work with. Names with spaces between words, and with non-standard characters like the >, the (, and the ) in them, are undesirable.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2022-12-12T15:12:41+00:00

    DIGS ID- primary key, highest level of neonatal care: Look up wizard drop down selection, Admission within 48 hours: Yes/No, >48 hours admission Yes/No, time in NICU/HDU/SCBU (free text but must be <50)

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2022-12-12T14:55:43+00:00

    I have attached a copy of the form below which feeds into a table with the same fields. We are collecting neonatal outcome data, therefore if the highest level of neonatal care was "none" the answer to the next fields is automatically no or 0.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2022-12-12T14:52:14+00:00

    If the answer is "no" to the first field the answer will always be the same for other fields therefore I would like it to autopopulate these fields to avoid the risk of data-entry error.

    Hi Katie,

    In the AfterUpdate event of the first control you can take your actions to set the other controls to "no" when the first control gets the value "no".

    But there is more to think about.

    What should happen if the first "no" is erased?

    What if some other control gets a value, and lateron the first control gets "no"?

    Perhaps you can start with only the first control visible, and all the rest hidden, to become visible when the first control <> "no" (but not Null)

    Imb.

    Was this answer helpful?

    0 comments No comments
  5. George Hepworth 22,855 Reputation points Volunteer Moderator
    2022-12-12T14:49:08+00:00

    While it is probably possible to do this, it is also probably the case that making multiple fields dependent on the value of one other field being True or False is an inappropriate table design. And that calls for more details about the table involved here. What are all of these fields? What data is in them?

    SHOW us, rather than describe the table, if you can, please.

    The rule for valid table design is that no field should be dependent on the value of another field in a table. But the details, again, will help us understand what the real situation is and how to address it appropriately, and not just with a work-around.

    Thank you.

    Was this answer helpful?

    0 comments No comments