Hi All
I've got this module below that works fine when I run the module from the module tab. When I use a command button on the main screen that is assigned to the module it does nothing. I cannot see what is the problem, I'm sure one of you will.
'------------------------------------------------------------
' UPDATE
'
'------------------------------------------------------------
Function UPDATE()
On Error GoTo UPDATE_Err
DoCmd.SetWarnings False
DoCmd.OpenQuery "MAKE LEDGER", acNormal, acEdit
DoCmd.OpenQuery "CLEAR TABLE RESULTS", acNormal, acEdit
DoCmd.OpenQuery "Q ALL ENTITIES BY ACCOUNT PER3-12", acNormal, acEdit
DoCmd.OpenQuery "Q ALL ENTITIES BY ACCCOUNT PER1&2", acNormal, acEdit
DoCmd.OpenQuery "RESULTS FOR REQUESTED PERIOD", acNormal, acEdit
DoCmd.Close acForm, "MAIN"
DoCmd.OpenForm "MAIN", acNormal, "", "", , acNormal
Beep
MsgBox "COMPLETE", vbInformation, "COMPLETE"
DoCmd.SetWarnings True
UPDATE_Exit:
Exit Function
UPDATE_Err:
MsgBox Error$
Resume UPDATE_Exit
End Function
Thanks for looking.
I've got this module below that works fine when I run the module from the module tab. When I use a command button on the main screen that is assigned to the module it does nothing. I cannot see what is the problem, I'm sure one of you will.
'------------------------------------------------------------
' UPDATE
'
'------------------------------------------------------------
Function UPDATE()
On Error GoTo UPDATE_Err
DoCmd.SetWarnings False
DoCmd.OpenQuery "MAKE LEDGER", acNormal, acEdit
DoCmd.OpenQuery "CLEAR TABLE RESULTS", acNormal, acEdit
DoCmd.OpenQuery "Q ALL ENTITIES BY ACCOUNT PER3-12", acNormal, acEdit
DoCmd.OpenQuery "Q ALL ENTITIES BY ACCCOUNT PER1&2", acNormal, acEdit
DoCmd.OpenQuery "RESULTS FOR REQUESTED PERIOD", acNormal, acEdit
DoCmd.Close acForm, "MAIN"
DoCmd.OpenForm "MAIN", acNormal, "", "", , acNormal
Beep
MsgBox "COMPLETE", vbInformation, "COMPLETE"
DoCmd.SetWarnings True
UPDATE_Exit:
Exit Function
UPDATE_Err:
MsgBox Error$
Resume UPDATE_Exit
End Function
Thanks for looking.