C
Chris
I have a Tab-Control with 5 tabs each with a differnt sub-form. On the On
Current event of each of the subforms, I want to use the following
=CheckEditingLevel([Forms]![Maintain Car]![cntPAActions])
to call the Function below. Unfortunately, I get the following error when I
move to the next record.
"The expression On Current you entered as the event property setting
produced the following error" Type mismatch." What's wrong??? Is it
something to do with the TabControl object???
Called Function
**********************************************
Function CheckEditingLevel(frmFormName As Form)
On Error GoTo Err_Form_Load
'**************************************************************************************
'Name: CheckEditingLevel
'Purpose: This Function set the formss "Allow" setting based on the users
Access Level.
'Author: Chris Premo
'Date: September 29, 2009
'Called by: This function is called by the Form's "OnLoad" event.
'**************************************************************************************
'This procedure checks the users access level as
'defined in the "tblPasswordTable" table. The Main Menu
If Forms![Main Menu]![AccessLevel] > 1 Then
frmFormName.AllowAdditions = False
frmFormName.AllowDeletions = False
frmFormName.AllowEdits = False
Else
frmFormName.AllowAdditions = True
frmFormName.AllowDeletions = True
frmFormName.AllowEdits = True
End If
Exit_Form_Load:
Exit Function
Err_Form_Load:
MsgBox Error$
Resume Exit_Form_Load
End Function
Current event of each of the subforms, I want to use the following
=CheckEditingLevel([Forms]![Maintain Car]![cntPAActions])
to call the Function below. Unfortunately, I get the following error when I
move to the next record.
"The expression On Current you entered as the event property setting
produced the following error" Type mismatch." What's wrong??? Is it
something to do with the TabControl object???
Called Function
**********************************************
Function CheckEditingLevel(frmFormName As Form)
On Error GoTo Err_Form_Load
'**************************************************************************************
'Name: CheckEditingLevel
'Purpose: This Function set the formss "Allow" setting based on the users
Access Level.
'Author: Chris Premo
'Date: September 29, 2009
'Called by: This function is called by the Form's "OnLoad" event.
'**************************************************************************************
'This procedure checks the users access level as
'defined in the "tblPasswordTable" table. The Main Menu
If Forms![Main Menu]![AccessLevel] > 1 Then
frmFormName.AllowAdditions = False
frmFormName.AllowDeletions = False
frmFormName.AllowEdits = False
Else
frmFormName.AllowAdditions = True
frmFormName.AllowDeletions = True
frmFormName.AllowEdits = True
End If
Exit_Form_Load:
Exit Function
Err_Form_Load:
MsgBox Error$
Resume Exit_Form_Load
End Function