Sorry to show my ignorance, but I need some help.
I am using Access 2007 and I have a form that is generated from a table (let's call it [MASTER]).
On this form, I have several text box fields (let's call them [FIELD1], [FIELD2], etc)
As I use this form to navigate through the records, I would like to the value of [FIELD1] to affect the format of [FIELD2]. For example, if [FIELD1] = Yes, then I would like [FIELD2] to be visible; and if [FIELD1] = No, then I would like [FIELD2] to be invisible.
I have written the following sub:
This works for the current record I am viewing, but when I navigate to another record the format of FIELD2 remains in the last state it was set...
What I would like is this: As I use the form to navigate through the record set, I would like Access to "read" the value of [FIELD1] for that record and set the format of [FIELD2] for that record accordingly.
What am I do wrong and how can I fix this?
I am using Access 2007 and I have a form that is generated from a table (let's call it [MASTER]).
On this form, I have several text box fields (let's call them [FIELD1], [FIELD2], etc)
As I use this form to navigate through the records, I would like to the value of [FIELD1] to affect the format of [FIELD2]. For example, if [FIELD1] = Yes, then I would like [FIELD2] to be visible; and if [FIELD1] = No, then I would like [FIELD2] to be invisible.
I have written the following sub:
HTML:
Private Sub FIELD2 AfterUpdate()
If FIELD1.Value = "Yes" Then FIELD2.Visible = True Else FIELD2.Invisible = False
End Sub
This works for the current record I am viewing, but when I navigate to another record the format of FIELD2 remains in the last state it was set...
What I would like is this: As I use the form to navigate through the record set, I would like Access to "read" the value of [FIELD1] for that record and set the format of [FIELD2] for that record accordingly.
What am I do wrong and how can I fix this?