msgbox change lenght

  • Thread starter Thread starter aceavl via AccessMonster.com
  • Start date Start date
A

aceavl via AccessMonster.com

hi all!

is there a way to change a msgbox so that depending in a value it has 2 or 3
or 4 lines?

change this:
MsgBox("Remisiones:" & vbNewLine _
& "Remision: " & strRem(0) & vbNewLine _
& "Remision: " & strRem(1) , vbYesNo, "Confirmacion")
to this:
MsgBox("Remisiones:" & vbNewLine _
& "Remision: " & strRem(0) & vbNewLine _
& "Remision: " & strRem(1) & vbNewLine _
& "Remision: " & strRem(2) , vbYesNo, "Confirmacion")

right now i'm doing it with a select case but there could be more than 50
lines and i don't like it!

any help is apreciated!
bye
 
hi,
is there a way to change a msgbox so that depending in a value it has 2 or 3
or 4 lines? No.

change this:
MsgBox("Remisiones:" & vbNewLine _
& "Remision: " & strRem(0) & vbNewLine _
& "Remision: " & strRem(1) , vbYesNo, "Confirmacion")
to this:
MsgBox("Remisiones:" & vbNewLine _
& "Remision: " & strRem(0) & vbNewLine _
& "Remision: " & strRem(1) & vbNewLine _
& "Remision: " & strRem(2) , vbYesNo, "Confirmacion")

right now i'm doing it with a select case but there could be more than 50
lines and i don't like it!
Use a For-Next loop:

Dim Count As Long
Dim Message As String

Message = "Remisiones:"
For Count = LBound(strRem()) To UBound(strRem())
Message = Message & vbNewLine & "Remision: " & strRem(Count)
Next Count

MsgBox Message, vbYesNo, "Confirmacion"



mfG
--> stefan <--
 
Just build the string separately, then plug it in to the msgbox syntax. then
you can do it however you want.
 
Back
Top