C
CSDunn
Hello,
I have a check box control on a subform that I want to set 'Enabled' to 'No'
if a bound text box on the subform contains NULL records, and set the check
box control 'Enabled' property to 'Yes' if the text box Is Not NULL. The
'Yes' or 'No' state of the check box needs to be obvious to the user after
the main form is opened.
I have a macro set up in an Access 2000 project for this, but whether the
text box in the subform is NULL or Is Not NULL, the check box control's
'Enabled' property always appears to be set to 'No'. That is, the check box
control is never enabled.
In the macro called 'Main.CountApproved', the first condition to turn the
'WOApproved' check box off is as follows. The 'WorkOrderID' text box control
that is being evaluated is actually in a subform that is within another
subform:
[Forms]![frmSite]![tblWorkOrder
Subform].[Form]![frmApproveAccess].[Form]![WorkOrderID] Is Null
The 'SetValue' action to occur on the 'Enabled' property of the checkbox
called 'WOapproved' in the 'frmApproveAccess' subform if the above statement
is true is as follows:
[Forms]![frmSite]![tblWorkOrder
Subform].[Form]![frmApproveAccess].[Form]![WOapproved].[Enabled] = No
The second condition in the macro is supposed to turn the checkbox on given
the following condition for the textbox:
[Forms]![frmSite]![tblWorkOrder
Subform].[Form]![frmApproveAccess].[Form]![WorkOrderID] Is Not Null
The 'SetValue' action for the 'Enabled' property of the checkbox, given that
the above statement is true, should be as follows:
[Forms]![frmSite]![tblWorkOrder
Subform].[Form]![frmApproveAccess].[Form]![WOapproved].[Enabled]=Yes
I have assigned the macro 'Main.CountApproved' to the 'On Current' event of
the main form, 'frmSite'. 'WorkOrderID' in the the 'frmApproveAccess'
subform is visible in order to eliminate a problem I was having with this
field being hidden. When 'WorkOrderID' was hidden, I would recieve a message
when opening the main form, 'frmSite' that said, "You can't disable a
control while it has the focus".
The 'Name' and 'Control Source' properties match for each control. There are
no error messages. Its just that the check box control is never enabled,
whether 'WorkOrderID' is null or not.
What do I need to do so that the checkbox will be enabled when 'WorkOrderID'
Is Not Null, and will be disabled when 'WorkOrderID' Is Null?
Thanks for your help!
CSDunn
I have a check box control on a subform that I want to set 'Enabled' to 'No'
if a bound text box on the subform contains NULL records, and set the check
box control 'Enabled' property to 'Yes' if the text box Is Not NULL. The
'Yes' or 'No' state of the check box needs to be obvious to the user after
the main form is opened.
I have a macro set up in an Access 2000 project for this, but whether the
text box in the subform is NULL or Is Not NULL, the check box control's
'Enabled' property always appears to be set to 'No'. That is, the check box
control is never enabled.
In the macro called 'Main.CountApproved', the first condition to turn the
'WOApproved' check box off is as follows. The 'WorkOrderID' text box control
that is being evaluated is actually in a subform that is within another
subform:
[Forms]![frmSite]![tblWorkOrder
Subform].[Form]![frmApproveAccess].[Form]![WorkOrderID] Is Null
The 'SetValue' action to occur on the 'Enabled' property of the checkbox
called 'WOapproved' in the 'frmApproveAccess' subform if the above statement
is true is as follows:
[Forms]![frmSite]![tblWorkOrder
Subform].[Form]![frmApproveAccess].[Form]![WOapproved].[Enabled] = No
The second condition in the macro is supposed to turn the checkbox on given
the following condition for the textbox:
[Forms]![frmSite]![tblWorkOrder
Subform].[Form]![frmApproveAccess].[Form]![WorkOrderID] Is Not Null
The 'SetValue' action for the 'Enabled' property of the checkbox, given that
the above statement is true, should be as follows:
[Forms]![frmSite]![tblWorkOrder
Subform].[Form]![frmApproveAccess].[Form]![WOapproved].[Enabled]=Yes
I have assigned the macro 'Main.CountApproved' to the 'On Current' event of
the main form, 'frmSite'. 'WorkOrderID' in the the 'frmApproveAccess'
subform is visible in order to eliminate a problem I was having with this
field being hidden. When 'WorkOrderID' was hidden, I would recieve a message
when opening the main form, 'frmSite' that said, "You can't disable a
control while it has the focus".
The 'Name' and 'Control Source' properties match for each control. There are
no error messages. Its just that the check box control is never enabled,
whether 'WorkOrderID' is null or not.
What do I need to do so that the checkbox will be enabled when 'WorkOrderID'
Is Not Null, and will be disabled when 'WorkOrderID' Is Null?
Thanks for your help!
CSDunn