S
segorese
Guest
I converted all my macros to modules and
then tried to use one command button
by pointing it to the function -- which does appear if you click on the ellipes.
The code can also be found in the Modules
tab.
When trying to run the command button using the module the system freezes up. The converted code is reproduced below.
I'm very new to coding. Does the freeze
up occur because of the Echo set to false
in the code? Is it because the macro
still exists in the Macro tab?
My macros all work so I'm puzzled as to
why the first conversion I tried has such
dismal results.
As I can only use this forum sparingly at work, can you direct any responses to
mailto:ses10@health.state.ny.us
Thank you for your time.
Steve Segore
Albany, NY USA
'------------------------------------------------------------
' mcr_open_main_switch
'
'------------------------------------------------------------
Function mcr_open_main_switch()
On Error GoTo mcr_open_main_switch_Err
' Closes open form and opens the main switchboard
DoCmd.Echo False, "Opening Main Switchboard"
' opens main switchboard
DoCmd.OpenForm "Main Switchboard", acNormal, "", "", acEdit, acNormal
DoCmd.Close acForm, "PLF Main"
DoCmd.Close acForm, "PLF Subform"
DoCmd.Close acForm, "Enrollment"
DoCmd.Close acForm, "Managed Care Only Lookup Form"
DoCmd.Close acForm, "PBII Information Form"
DoCmd.Close acForm, "PLF Main"
mcr_open_main_switch_Exit:
Exit Function
mcr_open_main_switch_Err:
MsgBox Error$
Resume mcr_open_main_switch_Exit
End Function
then tried to use one command button
by pointing it to the function -- which does appear if you click on the ellipes.
The code can also be found in the Modules
tab.
When trying to run the command button using the module the system freezes up. The converted code is reproduced below.
I'm very new to coding. Does the freeze
up occur because of the Echo set to false
in the code? Is it because the macro
still exists in the Macro tab?
My macros all work so I'm puzzled as to
why the first conversion I tried has such
dismal results.
As I can only use this forum sparingly at work, can you direct any responses to
mailto:ses10@health.state.ny.us
Thank you for your time.
Steve Segore
Albany, NY USA
'------------------------------------------------------------
' mcr_open_main_switch
'
'------------------------------------------------------------
Function mcr_open_main_switch()
On Error GoTo mcr_open_main_switch_Err
' Closes open form and opens the main switchboard
DoCmd.Echo False, "Opening Main Switchboard"
' opens main switchboard
DoCmd.OpenForm "Main Switchboard", acNormal, "", "", acEdit, acNormal
DoCmd.Close acForm, "PLF Main"
DoCmd.Close acForm, "PLF Subform"
DoCmd.Close acForm, "Enrollment"
DoCmd.Close acForm, "Managed Care Only Lookup Form"
DoCmd.Close acForm, "PBII Information Form"
DoCmd.Close acForm, "PLF Main"
mcr_open_main_switch_Exit:
Exit Function
mcr_open_main_switch_Err:
MsgBox Error$
Resume mcr_open_main_switch_Exit
End Function