Hide Control

G

Guest

Hello

I have a form with ceratin hidden controls. Depending upon the criteria of a
certain field these contols should be visible or hidden.
I used IF statment and on load event. It works fine only for the first
record of the form.
Example: If controls should be hidden for record 1 and 3 and visible for 2
Record1 contols will be hidden
Record2 contols will be visible
Record3 contols will be visible-----Should be hidden according to If
statement.

Please can you help me with this

Thank you and best reagrds
 
S

Steve Schapel

Bassel,

You won't be able to hide or show the controls. One option would be to
replace them with unbound controls, with their Control Source set to a
calculated expression that only shows the data if the conditions allow.
For example....
=IIf([CertainField]="A",[YourField],Null)

Another approach would be to use Conditional Formatting of the controls
(select from the Format menu in form design). You can't hide the
control, but you can conditionally change the ForeColor and BackColor to
be the same as the background colour of the form itself, so the control
appears hidden even though it is still there.
 

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