Continuous subform conditional formatting

G

Guest

I have an orders mainform and an OrderDetails subform. The subform is
continuous.
In the subform I have a checkbox called "Received" and a text box called
"ReceievedDate". What I want to happen is that when the checkbox is not
checked the DateReceived textbox is de-enabled. But when it is checked the
DateReceived textbox becomes enabled.

I have this code
Private Sub Received_AfterUpdate()
If Me.Received = True Then Me.ctrl_DateReceived.Enabled = True Else
Me.ctrl_DateReceived.Enabled = False
End Sub

But when any checkbox is checked ALL of the DateReceived textboxes in the
continuous form become enabled and not just the textbox relating to the
individual specific checkbox?

How can I make sure that checking a checkbox will only influence the
DateReceived textbox for that record?
 
S

Svetlana

Put the same code on current event of your form while you keep that one
on received_AfterUpdate event too.
 
S

Steve Schapel

Woody,

In design view of the form, select the ctrl_DateReceived textbox, and
then select Conditional Formatting from the Format menu. In the
'Expression is' box, put [Received]=0 and then set the format to disabled.

It is not possible to use VBA code to control the record-specific
properties of controls on a continuous form.
 
G

Guest

Thanks Steve just what I wanted
--
Thanks
WoodyAccess


Steve Schapel said:
Woody,

In design view of the form, select the ctrl_DateReceived textbox, and
then select Conditional Formatting from the Format menu. In the
'Expression is' box, put [Received]=0 and then set the format to disabled.

It is not possible to use VBA code to control the record-specific
properties of controls on a continuous form.

--
Steve Schapel, Microsoft Access MVP
I have an orders mainform and an OrderDetails subform. The subform is
continuous.
In the subform I have a checkbox called "Received" and a text box called
"ReceievedDate". What I want to happen is that when the checkbox is not
checked the DateReceived textbox is de-enabled. But when it is checked the
DateReceived textbox becomes enabled.

I have this code
Private Sub Received_AfterUpdate()
If Me.Received = True Then Me.ctrl_DateReceived.Enabled = True Else
Me.ctrl_DateReceived.Enabled = False
End Sub

But when any checkbox is checked ALL of the DateReceived textboxes in the
continuous form become enabled and not just the textbox relating to the
individual specific checkbox?

How can I make sure that checking a checkbox will only influence the
DateReceived textbox for that record?
 

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