visibility

  • Thread starter Thread starter Squibbly
  • Start date Start date
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??
 
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
 
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
 
Back
Top