Swiftraven
Technical User
Hi all,
I have a form that acts like a switchboard. In the VB code, I have declared a boolean variable that I set when one of the buttons is clicked. These buttons open another form and I want to control what fields are locked in that form depending upon which button is clicked on the first form.
On the first form, I declare the variable as:
Dim Manager As Boolean
and for each buttons on_click, set it either to True or False, then open the other form and then close the current form (though I have tried it without closing the current form, neither works).
On the resulting form, in the form open event, I have the following code
Private Sub Form_Open(Cancel As Integer)
If Forms![frm_FormSelection]![Manager] = False Then
Me![Budget].Disabled
Me![Actuals].Disabled
ElseIf Forms![frm_FormSelection]![Manager] = True Then
Me![Budget].Enabled
Me![Actuals].Enabled
End If
End Sub
Its erroring on the Manager section saying it can't find the field. I assume this is because it is looking for a control and not a variable. I need to be able to check the variable to determine the state of the form when its opened.
Thanks for any help
Jason
I have a form that acts like a switchboard. In the VB code, I have declared a boolean variable that I set when one of the buttons is clicked. These buttons open another form and I want to control what fields are locked in that form depending upon which button is clicked on the first form.
On the first form, I declare the variable as:
Dim Manager As Boolean
and for each buttons on_click, set it either to True or False, then open the other form and then close the current form (though I have tried it without closing the current form, neither works).
On the resulting form, in the form open event, I have the following code
Private Sub Form_Open(Cancel As Integer)
If Forms![frm_FormSelection]![Manager] = False Then
Me![Budget].Disabled
Me![Actuals].Disabled
ElseIf Forms![frm_FormSelection]![Manager] = True Then
Me![Budget].Enabled
Me![Actuals].Enabled
End If
End Sub
Its erroring on the Manager section saying it can't find the field. I assume this is because it is looking for a control and not a variable. I need to be able to check the variable to determine the state of the form when its opened.
Thanks for any help
Jason