473,387 Members | 1,899 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,387 software developers and data experts.

Blank msgBox

I have an email Sub set up that works fine except upon a successful
send I get a blank message box with just an OK button. How can I change
this to read something different? I have no event handler at all set up
yet, but still get the MsgBox... Thanks!

Private Sub SendEmail_Click()

On Error GoTo Err_SendEmail_Click
DoCmd.SendObject acSendNoObject, , , "Jo*****@ABCDE.com", , "Database
maintenance notice", _
"The Sales database can be re-opened and used as normal.", , _
False

Err_Command25_Click:
MsgBox Err.Description

End Sub

What I need is a msgbox that reads: "Notification Sent", vbOKOnly,
"Notification Sent"

Apr 24 '06 #1
2 3212
Note: Err_Command25_Click:
Should read: Err_SendEmail_Click:

Apr 24 '06 #2
Parasyke wrote:
I have an email Sub set up that works fine except upon a successful
send I get a blank message box with just an OK button. How can I change
this to read something different? I have no event handler at all set up
yet, but still get the MsgBox... Thanks!


You are getting the blank mailbox because there is nothing telling this
routine to ext the sub. So it goes on until it hits your msgbox - there
is no error, so the msgbox appears with no err.description.

Your code would be better structured this way:

Private Sub SendEmail_Click()

On Error GoTo Err_SendEmail_Click

DoCmd.SendObject acSendNoObject, , , "Jo*****@ABCDE.com", , "Database
maintenance notice", _
"The Sales database can be re-opened and used as normal.", , _
False

Exit_Proc:
Exit Sub

Err_SendEmail_Click:
MsgBox Err.Description
resume Exit_Proc

End Sub

My standard proc exit and error handler goes something like this:

Exit_Proc:

Exit Sub

Err_Proc:

Select Case Err.Number

Case whatever

'handle specific error

Case Else

MsgBox "Error " & Err.Number & " " & Err.Description, _
vbCritical, _
"Name_Of_Procedure", _
Err.HelpFile, Err.HelpContext

Resume Exit_Proc

End Select

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Apr 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tappy Tibbons | last post by:
I have a class I am serializing, and need the resultant XML to skip/omit classes that are not initialized, or their member variables have not been set. Is this possible? Say for the following...
19
by: Joe Scully | last post by:
Hi all, I am having trouble with access adding a blank record to a subform everytime I finish entering data and closing the form. (The form and subform are based on the one table) When...
2
by: jervin via AccessMonster.com | last post by:
Good Day, I want to get rid of the blank form everytime i open. I had a form link with a query and i wanted to prompt me sayin "data not found" instead of showing a blank form. i just dont know...
4
by: Larry Woods | last post by:
I have a seq. file with some blank lines (CrLf only) in it. When the line is read, I get a value of "Nothing" returned, which give me an "End of File" condition, so I terminate my procedure. ...
5
by: JackRazz | last post by:
Anyone know the regular expression to match a blank line where the byte sequence is "0D 0A 0D 0A" ive tried "\r\n\r\n+", "^$+" "\n\r" with no success. Any Ideas? Thanks - JackRazz This is...
4
by: Taylor | last post by:
Hello, This is driving me crazy, but I have a form with a filter button and when it is selected if there are no results then it is supposed to open a subform (error box). Below is my code: ...
2
by: Del | last post by:
I have a popup form that consist of a single field called EnteredBy and a Subform that has three fields. The popup form also has a button in the Form Footer called close. In the On Click event I...
1
imrosie
by: imrosie | last post by:
Hello (from Rosie the newbie), I recently got help with a wonderful event to perform this from 'thescripts'...it recognizes that a name is not in the list an allows for (after parsing first and...
4
by: barmatt80 | last post by:
I have created an unbound form so that when users enter the information, there is a save button they have to click, checking to make sure a field(txtDocketNo) is not blank. For some reason I cannot...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.