If - Then

G

Guest

I have a FORM that has a YES/NO checkbox for prompt LEIN. If the box is
checked I need the section for lein information to be visible. Likewise, the
opposite to occur if the box is not checked. I have four fields in the lein
section that need to be (in)visible according to the checkbox.

I looked up in the help section under "PROGRAM > Example of setting the
value of a property in response to an event" and found an example of the IF
statement that does exactly this. However, references OnCurrent. I don't
know what this is. When I have a field highlighted in the design view mode,
and then click the EVENT tab, I see other On xxxxxxx, but nothing about
OnCurrent.

Can someone please walk me through this? Can I place all four fields within
the IF statement to make visible or invisible or do I have to have four
different IF statements?

Thanks,
Les
 
R

Rick Brandt

WLMPilot said:
I have a FORM that has a YES/NO checkbox for prompt LEIN. If the box
is checked I need the section for lein information to be visible.
Likewise, the opposite to occur if the box is not checked. I have
four fields in the lein section that need to be (in)visible according
to the checkbox.

I looked up in the help section under "PROGRAM > Example of setting
the value of a property in response to an event" and found an example
of the IF statement that does exactly this. However, references
OnCurrent. I don't know what this is. When I have a field
highlighted in the design view mode, and then click the EVENT tab, I
see other On xxxxxxx, but nothing about OnCurrent.

Can someone please walk me through this? Can I place all four fields
within the IF statement to make visible or invisible or do I have to
have four different IF statements?

OnCurrent is an event proiperty of the *form*, not the control. The idea is
that you not only need to toggle the visible property in the AfterUpdate of the
Checkbox, but also when you navigate between records because some records will
have the box checked and some records will not. The code for the control does
not fire as you navigate records so you need to duplicate your code and have it
in both events.

Since the Visible property takes a True/False and your CheckBox value is also
True/False all you need are lines like...

Me!TextBoxName.Visible = Me!CheckBoxName
(repeat for all controls)
 

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