?
Solved

MsgBox loop

Posted on 2007-03-24
3
Medium Priority
?
809 Views
Last Modified: 2013-11-27
I am looping thru a recordset and updating based upon record flag checkbox.  I have a message box confirming prior to the update but it fires for every record that will be updated.  

Question:  Is there a way to code the message so that it will only fire once (for the group of records to be updated)?
0
Comment
Question by:zubin6220
[X]
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
  • 2
3 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 1200 total points
ID: 18785037
Place your message box statement before the loop (something like this)...

If MsgBox("Do You Want to Update These Records?, vbYesNo) = vbYes  Then
    Do until rs.EOF
          ....
          ...
     Loop
End if
'Your other code here


If the loop is all that is left in the procedure, you can get by without a block If statement and simplify it to:


If MsgBox("Do You Want to Update These Records?, vbYesNo) = vbNo  Then Exit Sub '** or exit function
Do until rs.EOF
          ....
          ...
Loop
End Sub
0
 

Author Comment

by:zubin6220
ID: 18785089
Yeah, that makes sense.  Thanks
0
 
LVL 61

Expert Comment

by:mbizup
ID: 18787953
Glad to help :-)
0

Featured Post

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

762 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