Solved

Large Warning Messages

Posted on 2000-04-07
5
136 Views
Last Modified: 2010-05-02
I am using a number of large warning messages should certain options be taken.

Is there a way of making something like this:-

"It appears that you are planning on making a major change to the existing data - if you take this option again you will lose ALL existing information"


lok like this
_______________________________________
"It Appears that you are planning on
  making a major change to the
         existing data

 If you take this option again you
            will lose
               ALL
      Existing information"
---------------------------------------
Basically what I am after is to use multiple lines of text to form the warning in the msgbox, rather than one line of text that autowraps and quite honestly looks poor.
0
Comment
Question by:Mister_Simon
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:Voodooman
Comment Utility
Hi!

Make your own message boxes!

Create a form that looks how you want - put a label on it and set the align to centre.


'all form code
Option Explicit

Public FormCaption As String
Public Message As String


Private Sub B_OK_Click()

Unload Me

End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyO Then B_OK_Click
End Sub

Private Sub Form_Load()

L_Caption.Caption = Message
Me.Caption = FormCaption
End Sub

This form has a button and a label on it.



Set up a global function and call the message box - here is a big Yes No message box.

Sub BigIMessage(Message As String, Title As String)

F_MsgBoxOK.Message = Message
F_MsgBoxOK.FormCaption = Title
F_MsgBoxOK.Show 1

end sub


'Call it

BigImessage "No Recs Exist!","Error"

You can have as many different Msgboxes as you want - I keep them and reuse them!


Good Luck


Voodooman!
0
 
LVL 3

Accepted Solution

by:
Gordonp earned 25 total points
Comment Utility
Insert vbCrLf at strategic Points

ie

sMSg = "It Appears that you are planning on" & vbcrlf _
       & "making a major change to the
         existing data" & vbcrlf _
etc..

MSgBOx sMsg

Gordon

0
 

Author Comment

by:Mister_Simon
Comment Utility
Voodooman,

This is too complicated for my purposes and I am only a VB beginner.

I am using Gordonp's answer as this is easy and serves the need perfectly.

Big apologies

Mister Simon
0
 

Author Comment

by:Mister_Simon
Comment Utility
Cheers Gordy,

That does the job.

Mister Simon
0
 
LVL 3

Expert Comment

by:Gordonp
Comment Utility
Glad to Help

Gordon
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now