"Hidden" control appears on every record instead of current record

S

Susan L

I have a control, dtCallDate, on a continuous subform. I would like for
dtCallDate to become visible whenever one of three values from a combo box is
selected. However, when I select one of the values (a string), the control
appears on all records in the subform, not just the current record.

The control is defined as Visible = No. The syntax for the code I am using
is taken from a working example on the main form. Perhaps my syntax is off
for the subform. here it is: (Forms![main form name]![control name of the
subform]![control name on subform])

Forms![frmDeployRecord]![DeployActivities]![dtCallDate].Visible =
(Forms![frmDeployRecord]![DeploymentActivities]![cboDPAction] = "Conference
Call Scheduled")

Any help will be appreciated.
 
M

Marshall Barton

Susan said:
I have a control, dtCallDate, on a continuous subform. I would like for
dtCallDate to become visible whenever one of three values from a combo box is
selected. However, when I select one of the values (a string), the control
appears on all records in the subform, not just the current record.

The control is defined as Visible = No. The syntax for the code I am using
is taken from a working example on the main form. Perhaps my syntax is off
for the subform. here it is: (Forms![main form name]![control name of the
subform]![control name on subform])

Forms![frmDeployRecord]![DeployActivities]![dtCallDate].Visible =
(Forms![frmDeployRecord]![DeploymentActivities]![cboDPAction] = "Conference
Call Scheduled")


Your syntax may be off, but it doesn't matter because you
can not manipulate the properties of a a control on a
specific row of a continuous/datasheet form. There is only
one control so a property setting applies to all rows.

The Conditional Formatting feature in A2000 and later allows
you to affect some display properties (color, enabled) but
not Visible.

I think the closest you can come is, (if you can't settle
for enable), is to select the same color for the ForeColor
and BackColor.

You may also need to use the Current even to lock/unlock
the text box.
 
S

Susan L

Marsh: Thanks. I didn't realize you can't control forms on subform records,
but I guess it makes sense. I did get the conditional enabled/disabled
working.

I would like to lock the control, but didn't see a "Current" event for the
text box. Is there another i should use?
--
susan


Marshall Barton said:
Susan said:
I have a control, dtCallDate, on a continuous subform. I would like for
dtCallDate to become visible whenever one of three values from a combo box is
selected. However, when I select one of the values (a string), the control
appears on all records in the subform, not just the current record.

The control is defined as Visible = No. The syntax for the code I am using
is taken from a working example on the main form. Perhaps my syntax is off
for the subform. here it is: (Forms![main form name]![control name of the
subform]![control name on subform])

Forms![frmDeployRecord]![DeployActivities]![dtCallDate].Visible =
(Forms![frmDeployRecord]![DeploymentActivities]![cboDPAction] = "Conference
Call Scheduled")


Your syntax may be off, but it doesn't matter because you
can not manipulate the properties of a a control on a
specific row of a continuous/datasheet form. There is only
one control so a property setting applies to all rows.

The Conditional Formatting feature in A2000 and later allows
you to affect some display properties (color, enabled) but
not Visible.

I think the closest you can come is, (if you can't settle
for enable), is to select the same color for the ForeColor
and BackColor.

You may also need to use the Current even to lock/unlock
the text box.
 
M

Marshall Barton

Susan said:
Marsh: Thanks. I didn't realize you can't control forms on subform records,
but I guess it makes sense. I did get the conditional enabled/disabled
working.

I would like to lock the control, but didn't see a "Current" event for the
text box. Is there another i should use?


This has nothing to do with subforms. It is a consequence
of using Continuous or Datasheet view.

The Current event is a **form** event that fires when you
navigate to a different record. Locking or unlocking a
control does not affect its appearance so you can not tell
if the control on other records are locked or not. This
does not matter because when you navigate to another record
the control is locked or not for that record.

The only time you will be able to tell if a control is
locked or not just by looking at it is when a control is
disabled and locked. When both properties are set, the
disabled control will appear normal, not grayed out.
 
S

Susan L

My apologies for my confusion -- continuous forms -- got it. Will try the
locking on the form's Current event, since I don't want anyone entering data
except under certain conditions. Thanks so much.
 

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