Turning On controls

G

Guest

I have a form in continuous form format which is based on a query.
I'm using the code below to make the CLOSEDHOWID control visible or
invisible depending on whether the ClosingReceipt check box is true or false.
The only problem is that once any ClosingReceipt is clicked to True, the
CLOSEDHOWID control for EVERY row of the form appears rather than just the
one where the CLOSDEDHOWID was checked.

Is there a way of making the CLOSEDHOWID control visible only for those
lines where the ClsoingReceipt has been checked to True?

Thanks,

FJ


Private Sub ClosingReceipt_AfterUpdate()
If Me.ClosingReceipt Then
' was false, is now true
Me.CLOSEDHOWID.Visible = True

Else
' Was true, now false
Me.CLOSEDHOWID = False ' switch off checkbox 2
Me.CLOSEDHOWID.Visible = False ' hide checkbox 2
End If

End Sub

Private Sub Form_Current()
If Me.ClosingReceipt = Null Then
' is true, show checkbox 2
Me.CLOSEDHOWID.Visible = True

Else
' Is false, hide checkbox 2
Me.CLOSEDHOWID.Visible = False
End If

End Sub
 
L

Larry Linson

FJquestioner said:
I have a form in continuous form format which is based on a query.
I'm using the code below to make the CLOSEDHOWID control visible or
invisible depending on whether the ClosingReceipt check box is true or
false.
The only problem is that once any ClosingReceipt is clicked to True, the
CLOSEDHOWID control for EVERY row of the form appears rather than just the
one where the CLOSDEDHOWID was checked.

Is there a way of making the CLOSEDHOWID control visible only for those
lines where the ClsoingReceipt has been checked to True?

There's only one "form", copied multiple times, in continuous Forms view.
Only those Controls bound to database fields can be displayed differently...
you could, as well, put your unbound control in the header or footer of the
Form... perhaps it would be less disturbing to the users if you put code in
the OnCurrent event to set its Enabled and Locked properties based on the
CheckBox... then when the user moves to another row/record, it will
automatically be reset.

Larry Linson
Microsoft Access MVP
 

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