D
DRMOB
I am trying to hide a text box on a subform if a check box is = to false. I
am close in doing so, but not there yet. This is what I have
In the AfterUpdate property of the check box I have the following:
Private Sub RevisedGrant_AfterUpdate()
If Me![RevisedGrant] = True Then
If MsgBox("Are you sure you want to revise this grant?", vbYesNo) =
vbNo Then
Me![RevisedGrant] = False
MsgBox "Grant will NOT be revised", vbOKOnly
Forms![DataEntryFrm]![ItemSubFrm]![Total$ofItemsRequestedSubfrm].Form![Revised Total Approved].Visible = False
End If
Else
If MsgBox("Are you sure you don't want to revise this grant?",
vbYesNo) = vbYes Then
Me![RevisedGrant] = False
MsgBox "You will not be revising the grant.", vbOKOnly
Else
Me![RevisedGrant] = True
Forms![DataEntryFrm]![ItemSubFrm]![Total$ofItemsRequestedSubfrm].Form![Revised Total Approved].Visible = True
End If
End If
In the On Current Property of the Subform (which is where the text box is I
am trying to hide) I have the following code:
Private Sub Form_Current()
If Forms![DataEntryFrm].Form![RevisedGrant] = True Then
Me.Revised_Total_Approved.Visible = True
Else
Me.Revised_Total_Approved.Visible = False
End If
End Sub
If I open the form and move from record to record, the text box is hidden if
the check box is false and shows if it is true. However, if I change it from
False to True, the text box does not appear until I move off the record and
back again. What am I missing? Please help, I've been on this for way too
long. Thanks
am close in doing so, but not there yet. This is what I have
In the AfterUpdate property of the check box I have the following:
Private Sub RevisedGrant_AfterUpdate()
If Me![RevisedGrant] = True Then
If MsgBox("Are you sure you want to revise this grant?", vbYesNo) =
vbNo Then
Me![RevisedGrant] = False
MsgBox "Grant will NOT be revised", vbOKOnly
Forms![DataEntryFrm]![ItemSubFrm]![Total$ofItemsRequestedSubfrm].Form![Revised Total Approved].Visible = False
End If
Else
If MsgBox("Are you sure you don't want to revise this grant?",
vbYesNo) = vbYes Then
Me![RevisedGrant] = False
MsgBox "You will not be revising the grant.", vbOKOnly
Else
Me![RevisedGrant] = True
Forms![DataEntryFrm]![ItemSubFrm]![Total$ofItemsRequestedSubfrm].Form![Revised Total Approved].Visible = True
End If
End If
In the On Current Property of the Subform (which is where the text box is I
am trying to hide) I have the following code:
Private Sub Form_Current()
If Forms![DataEntryFrm].Form![RevisedGrant] = True Then
Me.Revised_Total_Approved.Visible = True
Else
Me.Revised_Total_Approved.Visible = False
End If
End Sub
If I open the form and move from record to record, the text box is hidden if
the check box is false and shows if it is true. However, if I change it from
False to True, the text box does not appear until I move off the record and
back again. What am I missing? Please help, I've been on this for way too
long. Thanks