G
Guest
Hi, I'm new to writing modules and I'm looking for help with a specific code
I'm trying to run. I'm trying to use this module in numerous forms and based
on the forms caption, it should close the current form, opent the switchboard
and then re-name the caption of a text box which I'll run another module off
that caption. The problem I'm haing is it isn't recognizing the "Caption"
portion in the first line of code. It gives me an "Argument not Optional"
error.
Can anyone look at the following code and tell what's wrong with it? Thanks
in advance.
Public Function CloseTrainingFrm()
If Caption = "MXG Information Assurance Training" Then
DoCmd.Close
' DoCmd.OpenForm "frmSwitchboard"
' Forms!frmSwitchboard.IATraining = "Open MXG Training Form"
End If
End Function
I'm trying to run. I'm trying to use this module in numerous forms and based
on the forms caption, it should close the current form, opent the switchboard
and then re-name the caption of a text box which I'll run another module off
that caption. The problem I'm haing is it isn't recognizing the "Caption"
portion in the first line of code. It gives me an "Argument not Optional"
error.
Can anyone look at the following code and tell what's wrong with it? Thanks
in advance.
Public Function CloseTrainingFrm()
If Caption = "MXG Information Assurance Training" Then
DoCmd.Close
' DoCmd.OpenForm "frmSwitchboard"
' Forms!frmSwitchboard.IATraining = "Open MXG Training Form"
End If
End Function