Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Msgbox problem?

Author  Topic 

weedavie22
Starting Member

24 Posts

Posted - 2004-08-20 : 06:06:03
Here's the code:

errormsg:
MsgBox "PHOTO NOT FOUND (MAKE SURE THAT A PHOTO IS IN THE CORRECT FOLDER)

The problem is it displays it all in one line, I would like to display it like this:


PHOTO NOT FOUND

(MAKE SURE THAT THE PHOTO IS IN THE CORRECT FOLDER)



Any ideas on how to do this?

Thanks,

Dave.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-08-20 : 08:05:36
well you could add a newline character char(13) to the message. but i have no idea how to center align it...

Go with the flow & have fun! Else fight the flow :)
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2004-08-20 : 08:57:02
actually, use vbCrLF:

msgbox("hey there" & vbcrlf & vbcrlf & "How are you?")

If you need to center the text or do any kind of formatting -- just create your own form. add the text you need, graphics, bold, center, labels, command buttons, etc. Then open it like this:

docmd.openform "formname",,,acDialog ( not sure which param # it is, somewhere like that)

that will open the form modally, on top of other forms, and center it in the screen and basically make it look and act like a message box. Unlike the other OpenForm options, choosing acDialog will cause Access to hold off on executing the next statement until the form is closed. Just like the messagebox.



- Jeff
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2004-08-22 : 19:16:24
Uh, Jeff, aren't message boxes automatically centered? I usually have to add formatting if I want to make things line up differently.

-----------------------------------------------------
Words of Wisdom from AjarnMark, owner of Infoneering
Go to Top of Page
   

- Advertisement -