Auto fill form values

  • Thread starter Thread starter Dee Nixon
  • Start date Start date
D

Dee Nixon

I have a MS Access XP database. Within the database is a form with general
information on it. I will call it the Info form just to make it easier.
There is a button on the Info form that opens another form, I will call it
Additional Info form, created from another table within the database. I am
trying to force a field in the Info form to populate based on check box data
in the Additional Info Form.

Ex.

If additionalinfoform.box X = true then
infoform.fieldX = "yes"

I have done simular things in other forms, but the information was always
from the same table within the same form. This time I am trying to do it
from a linked table and form. I am out of ideas. Any help would be greatly
appreciated.
 
Seems to me like you could use code that looks close to your example "code."

You could check each checkbox in AdditionalInfoForm when it loads, and
change values in InfoForm accordingly. For example, in AdditionalInfoForm's
OnLoad event, you could code something like:

If Me.checkBoxA = True Then
Forms![InfoForm].fieldA = "yes"
Else
Forms![InfoForm].fieldA = "no"
End If

And you could code that for each checkbox and its corresponding field.

If the checkboxes can be changed by the user in AdditionalInfoForm, you
could check the status of a checkbox when it gets changed, and update the
corresponding field in InfoForm accordingly.

Since checkboxes are changed by getting clicked, you could put code just
like the above in the checkbox control's OnClick event. So in checkBoxB's
OnClick event, you might code something like:

If Me.checkBoxB = True Then
Forms![InfoForm].fieldB = "yes"
Else
Forms![InfoForm].fieldB = "no"
End If

Hope that helps. Good luck.

-ndalton
 
Back
Top