A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Turning On controls



 
 
Thread Tools Display Modes
  #1  
Old January 1st, 2007, 08:42 PM posted to microsoft.public.access.forms
FJquestioner
external usenet poster
 
Posts: 30
Default Turning On controls

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
  #2  
Old January 1st, 2007, 10:12 PM posted to microsoft.public.access.forms
Larry Linson
external usenet poster
 
Posts: 3,112
Default Turning On controls


"FJquestioner" wrote in message
...
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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.