adding picute to msgbox function

  • Thread starter Thread starter thread
  • Start date Start date
T

thread

Hi All,

is it posible to add picture in msgbox function,i know its quite a
limited function that its hard to access but is there any way its
posible to overcome this issue?
 
I don't believe that's possible, but you could create your own popup form
with a picture that you could use in place of the standard message box.
 
Create your own form that'll show exactly what you want, and use it as a
pop-up.

No, there's no way to add a picture to the existing MsgBox (although you can
add different icons). I talked about some of the enhancements that you can
make to the existing MsgBox in my May, 2005 "Access Answers" column in
Pinnacle Publication's "Smart Access" (you can download a copy of the
column, plus a sample database, for free from
http://www.accessmvp.com/DJSteele/SmartAccess.html ) but as I believe I
mentioned in the article, I wouldn't actual recommend using that technique
on a production application.
 
Hi All,

is it posible to add picture in msgbox function,i know its quite a
limited function that its hard to access but is there any way its
posible to overcome this issue?

No! You cannot add a picture to the MsgBox.

What you can do is create an unbound form to display instead of the
MsgBox. Now you can add a picture to the message form.

Here is an example of a message form, with 2 buttons, that you can
adapt to your needs.

Add a Label control and a Text control as well as 2 command buttons.
Name them cmdYes and cmdNo.

You can set the font style, size, color, etc., however you wish.

Code the cmdYes button's click event:
TextControlName = 1
Me.Visible = False

Code the cmdNo click event:
TextControlName = 2
Me.Visible = False

Add an Image control to display your image.

You would then open the form, using:

Dim strMessage as String
strMessage = "This is your message"
DoCmd.OpenForm "MessageFormName", , , , , acDialog, strMessage

If forms!MessageFormName!TextControlName = 1 then
' Do the Yes thing
Else
'Do the No thing
End If

DoCmd.Close acForm,"MessageFormName"

Code the Load event of the message box form:
LabelName.Caption = Me.OpenArgs

When the form is opened processing waits (just like a MsgBox) until
you click either command button. Then the Yes or No action will be
taken and the form closed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top