473,322 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Return result from Message Box

74
Ok so i have to following code.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command218_Click()
  2. On Error GoTo Err_218Click
  3.  
  4. DoCmd.SendObject acSendNoObject, , , "Daveh@specsales.com", , , "Request for Partition Drawing"
  5. Me.Text219 = "Waiting on Drawing."
  6. Exit_218:
  7. Exit Sub
  8. Err_218Click:
  9. GoTo Exit_218
  10.  
  11. End Sub
  12.  
now before the "Send Object command i want a box to appear and ask if the user is sure they want to send the email. if they click yes then continue with the code, and if they say no to exit the sub command.

I am decient with If Statements but have no ideal how to incorperate it into a message box.

Thanks in Advance!
Sep 7 '07 #1
3 1541
MMcCarthy
14,534 Expert Mod 8TB
Something like this should work ...

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command218_Click()
  2. On Error GoTo Err_218Click
  3. Dim rslt As Integer
  4.  
  5.     rslt = MsgBox ("Are you sure you want to send this mail", vbYesNo)
  6.     If rslt = vbYes Then
  7.         DoCmd.SendObject acSendNoObject, , , "Daveh@specsales.com", , , "Request for Partition Drawing"
  8.         Me.Text219 = "Waiting on Drawing."
  9.     End If
  10.  
  11. Exit_218:
  12.     Exit Sub
  13. Err_218Click:
  14.     GoTo Exit_218
  15.  
  16. End Sub
  17.  
Sep 7 '07 #2
lee123
556 512MB
well you could do this

Expand|Select|Wrap|Line Numbers
  1. msgbox("Do you want to send the email?",vbyesno + vbquestion,"whats your answer?") = vbyes then
  2. DoCmd.SendObject acSendNoObject, , , "Daveh@specsales.com", , , "Request for Partition Drawing"
  3. Me.Text219 = "Waiting on Drawing."
  4. else
  5. Exit_218:
  6. Exit Sub
  7. Err_218Click:
  8. GoTo Exit_218
Sep 7 '07 #3
Hutch
74
well you could do this

Expand|Select|Wrap|Line Numbers
  1. msgbox("Do you want to send the email?",vbyesno + vbquestion,"whats your answer?") = vbyes then
  2. DoCmd.SendObject acSendNoObject, , , "Daveh@specsales.com", , , "Request for Partition Drawing"
  3. Me.Text219 = "Waiting on Drawing."
  4. else
  5. Exit_218:
  6. Exit Sub
  7. Err_218Click:
  8. GoTo Exit_218

This worked great thank you.
Sep 14 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: w i l l | last post by:
Why does this work the way it does? If someone could explain return true, and return false to me I'd greatly appreciate it. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ...
3
by: learning_C++ | last post by:
I hope to use template. in my code I hope to sum the vector<int> and vector<double>. But there are several errors: sumtemplate.cpp:6: error: ISO C++ forbids declaration of `sum' with no type...
4
by: Bob Bedford | last post by:
We have no access to a mysql NG on my provider's server, so we ask here: We have a long query (long in text) with a UNION between 2 select. We have been informed that some times the query...
2
by: Rhino | last post by:
I am trying to verify that I correctly understand something I saw in the DB2 Information Center. I am running DB2 Personal Edition V8.2.1 on Windows. I came across the following in the Info...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
20
by: weston | last post by:
I've got a piece of code where, for all the world, it looks like this fails in IE 6: hometab = document.getElementById('hometab'); but this succeeds: hometabemt =...
2
by: philip | last post by:
hello, i am new to asp.net and sql server, and i have 3 questions for asking: 1. i am writing a store procedure of login validation for my asp.net application and wondering what the different...
5
by: samoore33 | last post by:
I use the code below to search through a DataSet: Dim t As DataTable t = result.Tables("State") Dim strExpr As String strExpr = "id = '" & theState.ToString() & "'" Dim foundRows() As DataRow...
11
by: =?Utf-8?B?Um9nZXIgVHJhbmNoZXo=?= | last post by:
Hello, I have a question about the infamous GOTO statement and the way to return a result from a sub: I have a sub that has to make some calls to external COM methods, and because these...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.