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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|