click next to continue or click cancel to abort

Posted on 2009-07-13
Last Modified: 2013-11-28
I have the following code but i need to add a popup to warn the user these querries are about to run and if they wish to continue then click next / if they wish to abort click cancel:

   With DoCmd
        .SetWarnings False
        .OpenQuery "Scan_For_NEW_VGP_CN_Records"
        .OpenQuery "Scan_For_NEW_VGP_Records"
        .OpenQuery "Scan_For_NEW_VGP_TS_Records"
        .OpenQuery "UPDATE_Vessel_Sum_In_Process"
        .SetWarnings True
    End With

MsgBox "Update complete!"

Can someone please help me add this functionality to this code?

Question by:HudsonMarine
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 500 total points
ID: 24840726

dim msg as string
msg="Queries are about to run and update records." & vbcrlf
msg=msg & "Click Ok to continue or Cancel to abort."

If (msgbox(msg,vbokcancel))=vbok then
   With DoCmd
        .SetWarnings False
        .OpenQuery "Scan_For_NEW_VGP_CN_Records"
        .OpenQuery "Scan_For_NEW_VGP_Records"
        .OpenQuery "Scan_For_NEW_VGP_TS_Records"
        .OpenQuery "UPDATE_Vessel_Sum_In_Process"
        .SetWarnings True
    End With

MsgBox "Update complete!"
    msgbox "Update aborted"
end if


Author Closing Comment

ID: 31602863
Thanks Capricorn1 - Morning to ya!

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question