Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command button does not do what its meant to do.

Status
Not open for further replies.

SuicidED

MIS
May 22, 2003
232
0
0
GB
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.
 
Hi James

It calls the module.
Private Sub Command14_Click()
UPDATE.UPDATE
End Sub

Eddie
 
first, i wouldnt use the word UPDATE as a function name, since that will probably confuse the hell out of Access. use something else like UpdateValues.

don't know why you have .update
just call the function with it's name (i've changed it's name to UpdateValues):

Private Sub Command14_Click()
UpdateValues
End Sub

hope this helps.
 
Hi Ginger

Thanks I tried that and it still messed up, so I redid the form and it worked again. For the life of me I've no idea what happened, but its working.

Many thanks Eddie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top