Avatar of SteveL13
SteveL13
Flag for United States of America asked on

Message box not working all of the time

I have a strange thing happening with a message box.  Here is the code of an onclick event of a command button:

    DoCmd.SetWarnings False

    DoCmd.RunSavedImportExport "ImportEstimateWon"
    DoCmd.RunSavedImportExport "EstimateWonOutbuys"

    DoCmd.SetWarnings True

    MsgBox "Estimate imported.  Proceed to job schedule.  Be sure to check for outside purchase information."

The problem is this... if there is no "EstimateWonOutbuys" import the message box does not appear.  If both imports take place then the message box does appear.  I need it to appear in either case.  There are cases where there is no import to be done for "EstimateWonOutbuys".

--Steve


 
Microsoft Access

Avatar of undefined
Last Comment
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

8/22/2022 - Mon
Rey Obrero (Capricorn1)

do you have error handling codes that goes with the codes above?

or, is there an
       on error resume next        line
Rey Obrero (Capricorn1)

comment this two lines, then test your codes again

' DoCmd.SetWarnings False


'  DoCmd.SetWarnings True
SteveL13

ASKER
I commented those two lines out and the message box did not popup when only the first import existed.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Rey Obrero (Capricorn1)

what about the first question?
ASKER CERTIFIED SOLUTION
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.