visibility

S

Squibbly

i want to set a field on a form to be "greyed" out when a certain condition
applies in another field which is a combo box eg.
when the combo in a from equals a certain condition then i want the field
concerned "greyed out" is
Form.formname.field.Visible=false a valid argument??
 
N

Nikos Yannacopoulos

Squibbly,

To begin with, do not confuse fields with controls. Fields hold data items
of specific type/size in table records; the objects on forms, reports etc
that are used to enter, edit or display data, whether stored in table fields
or not (unbound controls) are called Controls. Now:

The general syntax to refer to a control on a form would be:

Forms.FormName.ControlName

If the code is in the form's own module, you can use the Me. keyword
instead, like:

Me.ControlName

Also, to "grey out" you need to play with the Enabled property. So, in the
form's own module you would use:

Me.ControlName.Enabled = False

In another module, you would use:

Forms!FormName.ControlName.Enabled = False

HTH,
Nikos
 
S

Squibbly

ok thank you for your advice on this

Nikos Yannacopoulos said:
Squibbly,

To begin with, do not confuse fields with controls. Fields hold data items
of specific type/size in table records; the objects on forms, reports etc
that are used to enter, edit or display data, whether stored in table
fields
or not (unbound controls) are called Controls. Now:

The general syntax to refer to a control on a form would be:

Forms.FormName.ControlName

If the code is in the form's own module, you can use the Me. keyword
instead, like:

Me.ControlName

Also, to "grey out" you need to play with the Enabled property. So, in the
form's own module you would use:

Me.ControlName.Enabled = False

In another module, you would use:

Forms!FormName.ControlName.Enabled = False

HTH,
Nikos
 

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