Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / August 2006

Tip: Looking for answers? Try searching our database.

How to create a warning msg box?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jesZee - 14 Aug 2006 20:20 GMT
Hi experts,

I have a pop-up msg box that ask the user to click OK to proceed and
Cancel to stop the macro from running further. It is noted in my macro
condition under Msgbox action. Code:

MsgBox("Proceed with the queries?",1)=1

But, if I click on "Cancel", the macro will keep running - what should
I do to stop it? If I put in "StopMacro", this will stop my macro no
matter if I click OK or Cancel.

Pls help....THANK U!

J.
jmonty - 14 Aug 2006 20:42 GMT
You are assigning the value of the answer (=1).
You should be listening for the (return value) answer:

Dim intReturnValue as Integer
intReturnValue  = MsgBox("Proceed with the queries?", _
                         vbQuestion + vbYesNo, "Continue?")
'Msgbox return values: vbYes, vbNo, vbOK, vbCancel
If intReturnValue = vbYes then
   'perform action here
Else
   Exit sub
End If

jmonty

> Hi experts,
>
[quoted text clipped - 11 lines]
>
> J.
jesZee - 15 Aug 2006 20:52 GMT
jmonty,

thanks for that code but i m very green when it comes to coding.

i m using macro design to get thru this pop-up msg - can you enlighten
me either putting the codes in the visual basic or in macro.

thanks a lot.

j.

> You are assigning the value of the answer (=1).
> You should be listening for the (return value) answer:
[quoted text clipped - 26 lines]
> >
> > J.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.