Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

avoid question message box

Posted on 2014-02-05
3
Medium Priority
?
310 Views
Last Modified: 2014-02-22
hi, in the below code, how can we avoid the question and still do a full processing? (there is no decision making needed anymore.. the equivalent of "Yes" should be the default.. can you suggest how this code should be changed to accomplish this? thanks-
=============================
 Dim msg As String
  msg = "Would you like to process all (" + LTrim(Str(NumRecsToDo)) + ") records for: " + _
         Chr(13) + Chr(10) + Chr(13) + Chr(10) + Sender1 + IIf(Len(Sender2), " ," + Sender2, "")
  Response = MsgBox(msg, vbYesNoCancel + vbQuestion, "Process Confirmation")
  Select Case Response
    Case 6
      'Process All Records
      LabNum = 0
    Case 7
      Set db = CurrentDb()
      RecSource = "AFRTesting Where Report_Num = '" + ReportNum + "';"
      Set Ds2 = db.OpenRecordset("Select * From " + RecSource, dbOpenDynaset)
      Ds2.MoveLast
      NumRecsToDo = Ds2.RecordCount
 
    Case 2
      MsgBox "AFR Report Request Cancelled By User"
      Exit Sub
  End Select
0
Comment
Question by:25112
[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
3 Comments
 
LVL 53

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 668 total points
ID: 39838042
Hi,

pls try

Dim msg As String
  msg = "Would you like to process all (" + LTrim(Str(NumRecsToDo)) + ") records for: " + _
         Chr(13) + Chr(10) + Chr(13) + Chr(10) + Sender1 + IIf(Len(Sender2), " ," + Sender2, "")
  Response = MsgBox(msg, vbOKCancel + vbQuestion, "Process Confirmation")
  Select Case Response
    Case 1
      'Process All Records
      LabNum = 0
    Case 2
      MsgBox "AFR Report Request Cancelled By User"
      Exit Sub
  End Select

Open in new window


if you want no MsgBox

use
LabNum = 0

Open in new window

Regards
0
 
LVL 19

Assisted Solution

by:MINDSUPERB
MINDSUPERB earned 664 total points
ID: 39838058
Hello 25112,

I may suggest to comment out all those code (I mean all that you posted) and run it. You may delete them later once it gives you what you want.

Those codes as I understand are used in the question message that you don't like to appear.

Sincerely,

Ed
0
 
LVL 51

Accepted Solution

by:
Gustav Brock earned 668 total points
ID: 39838147
Well, vbYes is 6 so remove all your code and leave this:

      'Process All Records
      LabNum = 0

That's all for a default Yes.

/gustav
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

670 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