PC Review


Reply
Thread Tools Rate Thread

Custom msgbox help needed!!!

 
 
zz
Guest
Posts: n/a
 
      8th Dec 2006
hi everyone, it's me again buggin off with me little project that's driving
me insane.

this time is somthing i just like to call a nice feature in my VBA based
app.

i hace created a custom msgbox that show a different image depending on the
typeofmsg parameter i pass into a function

i kindda declare my function like follows:



public function showmsg (msg as string,title as string, typeofmsg as
integer)


into the function you can see [ actually not yet, til i finish my project]

'/// important, i set the frmMsg properties because i use the same userform
everytime i need to display a msg.


frmMsg.LblMsg.caption=Msg '// this is the message displayed

frmMsg.Caption= title ' // this is the title of my custom Msgbox

'// here i select if the typeofmsg is equal to an errormsg or a wrningmsg or
an allOKmsg
select case typeofmsg
case is =1
frmMsg.Pct.Picture=IMG1 ' //IMG1 is an object containing the errormsg
image
case is =2
frmMsg.Pct.Picture=IMG2 ' //IMG2 is an object containing the wrningmsg
image
case is =3
frmMsg.Pct.Picture=IMG3 ' //IMG3 is an object containing the allOKmsg
image

end select



till this point everything works just fine

every time i call showmsg("Crap!","Told you!!",1)


the nice popup windows does it's job.


but now i need an extra from this lil ' fellow, i need it to return a
value, like the regular msgbox

EG,

when i say X=msgbox("dude!, what are you smokin' ?, are you for real??
",VByesnocancel,"be aware, your files will be deleted!!!")

i can know if X=VByes or X=VBno

so now, i need ideas about implementing this in my function


any help will be welcome!!!!


thanks in advantage!!


--
---
zz [MX]
cuasi-musico,semi-poeta y loco



 
Reply With Quote
 
 
 
 
zz
Guest
Posts: n/a
 
      9th Dec 2006
thanks for the reply but i have already figured it out !!!...

if anybody wants to know how send me an email to
Jarious[dot]com[at]gmail[dot]com


--
---
zz [MX]
cuasi-musico,semi-poeta y loco

"Simon Lloyd" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
>
> Hi not sure entirely what you want to do but this is how to make use of
> Yes, No and Cancel from a message box:
>
>
> Code:
> --------------------
> Sub Mbox()
> Select Case MsgBox("What Now", vbYesNoCancel, "Decision Maker")
> Case vbYes
> MsgBox "Good"
> Case vbNo
> MsgBox "Bad"
> Case vbCancel
> MsgBox "Ugly"
> End Select
>
> End Sub
> --------------------
> Hope this helps,
> Regards,
> Simon
>
>
> --
> Simon Lloyd



 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      9th Dec 2006
You mean if I was reading this thread and I wanted to find out the solution,
I would need to send an email to


(E-Mail Removed)


Doesn't seem like that is in the spirit of the newsgroup?

--
Regards,
Tom Ogilvy



"zz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> thanks for the reply but i have already figured it out !!!...
>
> if anybody wants to know how send me an email to
> Jarious[dot]com[at]gmail[dot]com
>
>
> --
> ---
> zz [MX]
> cuasi-musico,semi-poeta y loco
>
> "Simon Lloyd" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>>
>> Hi not sure entirely what you want to do but this is how to make use of
>> Yes, No and Cancel from a message box:
>>
>>
>> Code:
>> --------------------
>> Sub Mbox()
>> Select Case MsgBox("What Now", vbYesNoCancel, "Decision Maker")
>> Case vbYes
>> MsgBox "Good"
>> Case vbNo
>> MsgBox "Bad"
>> Case vbCancel
>> MsgBox "Ugly"
>> End Select
>>
>> End Sub
>> --------------------
>> Hope this helps,
>> Regards,
>> Simon
>>
>>
>> --
>> Simon Lloyd

>
>



 
Reply With Quote
 
zz
Guest
Posts: n/a
 
      9th Dec 2006
well, thanks for all the spam i will get.[ no hard feelings]


i am completely sorry if that was the impression i caused, of course i do
not mean breaking the spirit of the group, no, sorry again.


Bad zz !! bad zz !!, no cookies for you tonight!!!



so for my redemption.


'// i know it has some 'scratches' and it could have been a little bit more
effective, but i'm under a little pressure to finish this '//before xmas and
as long as it works...




in a regular module called msgs i declared this function



Public returnanswer As Integer ' ///this is a global variable that can be
set from Frmmsg's events

Public Function Messagebox(Msg As String, Title As String, typeofmsg As
Integer) As String

On Error GoTo errhandler

Load Frmmsg '// this loads the userform that 'acts' as the msgbox but
doesn't show it yet

Frmmsg.lblmsg.Caption = Msg '// places the message

Frmmsg.Caption = Title ' // sets the title ,obviously


Select Case typeofmsg
Case Is = 1
Frmmsg.typeofmsj.Picture =
LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgwarn.jpg") '// show
the 'yellow message sphere

Case Is = 2
Frmmsg.typeofmsj.Picture =
LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgerr.jpg") '// show
the
' red sphere pic

Case Is = 3
Frmmsg.typeofmsj.Picture =
LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgsuccess.jpg") '//
show
'the green sphere pic

End Select

Frmmsg.Show

'// this part is for the Messagebox to return a value that
can be handled like the VByes response in a regular msgbox

Select Case msgs.returnanswer

Case Is = 1
Messagebox= "TByes"
Case Is = 2
Messagebox = "TBNot"
Case Is = 3
Messagebox = "TBcancel"
End Select

errhandler:
Err.Clear
End Function



Now


in the Frmmsg i have three buttons one for yes, another for no and a
third for cancel




private sub Btntbyes_onclick

msgs.returnanswer=1 '// this is for the Messagebox function to return
"TByes"

unload frmmsg '// cause we don't need the msg anymore

end sub


private sub Btntbnot_onclick

msgs.returnanswer=2 '// this is for the Messagebox function to return "TBno"

unload frmmsg '// cause we don't need the msg anymore

end sub

private sub Btntbcancel_onclick

msgs.returnanswer=3 '// this is for the Messagebox function to return
"TBcancel"

unload frmmsg '// cause we don't need the msg anymore

end sub



so now i can write


X= Messagebox("Wow " & application.username & " you're handsome!! " &
VbCrlf & " am i right?" ,"Self esteem enhancer",3)
if x="TByes"
then
Messagebox "Liar!!!!","Go back to work",2
else
Messagebox "c'mon!, you know youre not but i still like you the best ","
Please return to your activities",3
endif

actually this is not the purpose for what i use it, but i tought this would
be funnier.


Best regards, hope it may be usefull.


--
:=)
---
zz [MX]
cuasi-musico,semi-poeta y loco



"Tom Ogilvy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You mean if I was reading this thread and I wanted to find out the
> solution, I would need to send an email to
>
>
> (E-Mail Removed)
>
>
> Doesn't seem like that is in the spirit of the newsgroup?
>
> --
> Regards,
> Tom Ogilvy
>
>
>
> "zz" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> thanks for the reply but i have already figured it out !!!...
>>
>> if anybody wants to know how send me an email to
>> Jarious[dot]com[at]gmail[dot]com
>>
>>
>> --
>> ---
>> zz [MX]
>> cuasi-musico,semi-poeta y loco
>>
>> "Simon Lloyd" <(E-Mail Removed)> wrote
>> in message news:(E-Mail Removed)...
>>>
>>> Hi not sure entirely what you want to do but this is how to make use of
>>> Yes, No and Cancel from a message box:
>>>
>>>
>>> Code:
>>> --------------------
>>> Sub Mbox()
>>> Select Case MsgBox("What Now", vbYesNoCancel, "Decision Maker")
>>> Case vbYes
>>> MsgBox "Good"
>>> Case vbNo
>>> MsgBox "Bad"
>>> Case vbCancel
>>> MsgBox "Ugly"
>>> End Select
>>>
>>> End Sub
>>> --------------------
>>> Hope this helps,
>>> Regards,
>>> Simon
>>>
>>>
>>> --
>>> Simon Lloyd

>>
>>

>
>



 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      9th Dec 2006
I wouldn't be too concerned about "all the spam". I have been posting here
for 9 years using an unprotected email address and wouldn't consider the
amount of SPAM I get to be any big deal.

Using a public variable is pretty standard fare. Unfortunately, you made it
sound like you had a major discovery.

but thanks for posting your solution! - I am sure it will be useful for
many.

--
Regards,
Tom Ogilvy


"zz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> well, thanks for all the spam i will get.[ no hard feelings]
>
>
> i am completely sorry if that was the impression i caused, of course i do
> not mean breaking the spirit of the group, no, sorry again.
>
>
> Bad zz !! bad zz !!, no cookies for you tonight!!!
>
>
>
> so for my redemption.
>
>
> '// i know it has some 'scratches' and it could have been a little bit
> more effective, but i'm under a little pressure to finish this '//before
> xmas and as long as it works...
>
>
>
>
> in a regular module called msgs i declared this function
>
>
>
> Public returnanswer As Integer ' ///this is a global variable that can
> be set from Frmmsg's events
>
> Public Function Messagebox(Msg As String, Title As String, typeofmsg As
> Integer) As String
>
> On Error GoTo errhandler
>
> Load Frmmsg '// this loads the userform that 'acts' as the msgbox but
> doesn't show it yet
>
> Frmmsg.lblmsg.Caption = Msg '// places the message
>
> Frmmsg.Caption = Title ' // sets the title ,obviously
>
>
> Select Case typeofmsg
> Case Is = 1
> Frmmsg.typeofmsj.Picture =
> LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgwarn.jpg") '// show
> the 'yellow message sphere
>
> Case Is = 2
> Frmmsg.typeofmsj.Picture =
> LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgerr.jpg") '// show
> the
> ' red sphere pic
>
> Case Is = 3
> Frmmsg.typeofmsj.Picture =
> LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgsuccess.jpg") '//
> show
> 'the green sphere pic
>
> End Select
>
> Frmmsg.Show
>
> '// this part is for the Messagebox to return a value that
> can be handled like the VByes response in a regular msgbox
>
> Select Case msgs.returnanswer
>
> Case Is = 1
> Messagebox= "TByes"
> Case Is = 2
> Messagebox = "TBNot"
> Case Is = 3
> Messagebox = "TBcancel"
> End Select
>
> errhandler:
> Err.Clear
> End Function
>
>
>
> Now
>
>
> in the Frmmsg i have three buttons one for yes, another for no and a
> third for cancel
>
>
>
>
> private sub Btntbyes_onclick
>
> msgs.returnanswer=1 '// this is for the Messagebox function to return
> "TByes"
>
> unload frmmsg '// cause we don't need the msg anymore
>
> end sub
>
>
> private sub Btntbnot_onclick
>
> msgs.returnanswer=2 '// this is for the Messagebox function to return
> "TBno"
>
> unload frmmsg '// cause we don't need the msg anymore
>
> end sub
>
> private sub Btntbcancel_onclick
>
> msgs.returnanswer=3 '// this is for the Messagebox function to return
> "TBcancel"
>
> unload frmmsg '// cause we don't need the msg anymore
>
> end sub
>
>
>
> so now i can write
>
>
> X= Messagebox("Wow " & application.username & " you're handsome!! " &
> VbCrlf & " am i right?" ,"Self esteem enhancer",3)
> if x="TByes"
> then
> Messagebox "Liar!!!!","Go back to work",2
> else
> Messagebox "c'mon!, you know youre not but i still like you the best ","
> Please return to your activities",3
> endif
>
> actually this is not the purpose for what i use it, but i tought this
> would be funnier.
>
>
> Best regards, hope it may be usefull.
>
>
> --
> :=)
> ---
> zz [MX]
> cuasi-musico,semi-poeta y loco
>
>
>
> "Tom Ogilvy" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> You mean if I was reading this thread and I wanted to find out the
>> solution, I would need to send an email to
>>
>>
>> (E-Mail Removed)
>>
>>
>> Doesn't seem like that is in the spirit of the newsgroup?
>>
>> --
>> Regards,
>> Tom Ogilvy
>>
>>
>>
>> "zz" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> thanks for the reply but i have already figured it out !!!...
>>>
>>> if anybody wants to know how send me an email to
>>> Jarious[dot]com[at]gmail[dot]com
>>>
>>>
>>> --
>>> ---
>>> zz [MX]
>>> cuasi-musico,semi-poeta y loco
>>>
>>> "Simon Lloyd" <(E-Mail Removed)> wrote
>>> in message news:(E-Mail Removed)...
>>>>
>>>> Hi not sure entirely what you want to do but this is how to make use of
>>>> Yes, No and Cancel from a message box:
>>>>
>>>>
>>>> Code:
>>>> --------------------
>>>> Sub Mbox()
>>>> Select Case MsgBox("What Now", vbYesNoCancel, "Decision Maker")
>>>> Case vbYes
>>>> MsgBox "Good"
>>>> Case vbNo
>>>> MsgBox "Bad"
>>>> Case vbCancel
>>>> MsgBox "Ugly"
>>>> End Select
>>>>
>>>> End Sub
>>>> --------------------
>>>> Hope this helps,
>>>> Regards,
>>>> Simon
>>>>
>>>>
>>>> --
>>>> Simon Lloyd
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
zz
Guest
Posts: n/a
 
      9th Dec 2006
yah, i dont mind too much for the spam, gmail's filter works pretty fine.

well and , it is a major discovery to me in my very personal way, i do not
know too much about VBA or VB or XL, and everything i know is thanks to
everybody here, and i am sure that here are some enthusiasts that are
'discovering' this tool just like me, and i thougth it would be nice to
share this with them.

guess it shouldn't be a great discovery to you, since you are a great expert
on this subject...

but wath the hell, it is like glory to me when something i had never done
before works well.

regards.


--
---
zz [MX]
cuasi-musico,semi-poeta y loco


"Tom Ogilvy" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>I wouldn't be too concerned about "all the spam". I have been posting here
>for 9 years using an unprotected email address and wouldn't consider the
>amount of SPAM I get to be any big deal.
>
> Using a public variable is pretty standard fare. Unfortunately, you made
> it sound like you had a major discovery.
>
> but thanks for posting your solution! - I am sure it will be useful for
> many.
>
> --
> Regards,
> Tom Ogilvy
>
>
> "zz" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> well, thanks for all the spam i will get.[ no hard feelings]
>>
>>
>> i am completely sorry if that was the impression i caused, of course i do
>> not mean breaking the spirit of the group, no, sorry again.
>>
>>
>> Bad zz !! bad zz !!, no cookies for you tonight!!!
>>
>>
>>
>> so for my redemption.
>>
>>
>> '// i know it has some 'scratches' and it could have been a little bit
>> more effective, but i'm under a little pressure to finish this '//before
>> xmas and as long as it works...
>>
>>
>>
>>
>> in a regular module called msgs i declared this function
>>
>>
>>
>> Public returnanswer As Integer ' ///this is a global variable that can
>> be set from Frmmsg's events
>>
>> Public Function Messagebox(Msg As String, Title As String, typeofmsg As
>> Integer) As String
>>
>> On Error GoTo errhandler
>>
>> Load Frmmsg '// this loads the userform that 'acts' as the msgbox but
>> doesn't show it yet
>>
>> Frmmsg.lblmsg.Caption = Msg '// places the message
>>
>> Frmmsg.Caption = Title ' // sets the title ,obviously
>>
>>
>> Select Case typeofmsg
>> Case Is = 1
>> Frmmsg.typeofmsj.Picture =
>> LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgwarn.jpg") '//
>> show the 'yellow message sphere
>>
>> Case Is = 2
>> Frmmsg.typeofmsj.Picture =
>> LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgerr.jpg") '// show
>> the
>> ' red sphere pic
>>
>> Case Is = 3
>> Frmmsg.typeofmsj.Picture =
>> LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgsuccess.jpg") '//
>> show
>> 'the green sphere pic
>>
>> End Select
>>
>> Frmmsg.Show
>>
>> '// this part is for the Messagebox to return a value that
>> can be handled like the VByes response in a regular msgbox
>>
>> Select Case msgs.returnanswer
>>
>> Case Is = 1
>> Messagebox= "TByes"
>> Case Is = 2
>> Messagebox = "TBNot"
>> Case Is = 3
>> Messagebox = "TBcancel"
>> End Select
>>
>> errhandler:
>> Err.Clear
>> End Function
>>
>>
>>
>> Now
>>
>>
>> in the Frmmsg i have three buttons one for yes, another for no and a
>> third for cancel
>>
>>
>>
>>
>> private sub Btntbyes_onclick
>>
>> msgs.returnanswer=1 '// this is for the Messagebox function to return
>> "TByes"
>>
>> unload frmmsg '// cause we don't need the msg anymore
>>
>> end sub
>>
>>
>> private sub Btntbnot_onclick
>>
>> msgs.returnanswer=2 '// this is for the Messagebox function to return
>> "TBno"
>>
>> unload frmmsg '// cause we don't need the msg anymore
>>
>> end sub
>>
>> private sub Btntbcancel_onclick
>>
>> msgs.returnanswer=3 '// this is for the Messagebox function to return
>> "TBcancel"
>>
>> unload frmmsg '// cause we don't need the msg anymore
>>
>> end sub
>>
>>
>>
>> so now i can write
>>
>>
>> X= Messagebox("Wow " & application.username & " you're handsome!! " &
>> VbCrlf & " am i right?" ,"Self esteem enhancer",3)
>> if x="TByes"
>> then
>> Messagebox "Liar!!!!","Go back to work",2
>> else
>> Messagebox "c'mon!, you know youre not but i still like you the best
>> "," Please return to your activities",3
>> endif
>>
>> actually this is not the purpose for what i use it, but i tought this
>> would be funnier.
>>
>>
>> Best regards, hope it may be usefull.
>>
>>
>> --
>> :=)
>> ---
>> zz [MX]
>> cuasi-musico,semi-poeta y loco
>>
>>
>>
>> "Tom Ogilvy" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> You mean if I was reading this thread and I wanted to find out the
>>> solution, I would need to send an email to
>>>
>>>
>>> (E-Mail Removed)
>>>
>>>
>>> Doesn't seem like that is in the spirit of the newsgroup?
>>>
>>> --
>>> Regards,
>>> Tom Ogilvy
>>>
>>>
>>>
>>> "zz" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> thanks for the reply but i have already figured it out !!!...
>>>>
>>>> if anybody wants to know how send me an email to
>>>> Jarious[dot]com[at]gmail[dot]com
>>>>
>>>>
>>>> --
>>>> ---
>>>> zz [MX]
>>>> cuasi-musico,semi-poeta y loco
>>>>
>>>> "Simon Lloyd" <(E-Mail Removed)> wrote
>>>> in message news:(E-Mail Removed)...
>>>>>
>>>>> Hi not sure entirely what you want to do but this is how to make use
>>>>> of
>>>>> Yes, No and Cancel from a message box:
>>>>>
>>>>>
>>>>> Code:
>>>>> --------------------
>>>>> Sub Mbox()
>>>>> Select Case MsgBox("What Now", vbYesNoCancel, "Decision Maker")
>>>>> Case vbYes
>>>>> MsgBox "Good"
>>>>> Case vbNo
>>>>> MsgBox "Bad"
>>>>> Case vbCancel
>>>>> MsgBox "Ugly"
>>>>> End Select
>>>>>
>>>>> End Sub
>>>>> --------------------
>>>>> Hope this helps,
>>>>> Regards,
>>>>> Simon
>>>>>
>>>>>
>>>>> --
>>>>> Simon Lloyd
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      10th Dec 2006
I said thanks for posting your solution and that it would be useful.

--
Regards,
Tom Ogilvy

"zz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> yah, i dont mind too much for the spam, gmail's filter works pretty fine.
>
> well and , it is a major discovery to me in my very personal way, i do not
> know too much about VBA or VB or XL, and everything i know is thanks to
> everybody here, and i am sure that here are some enthusiasts that are
> 'discovering' this tool just like me, and i thougth it would be nice to
> share this with them.
>
> guess it shouldn't be a great discovery to you, since you are a great
> expert on this subject...
>
> but wath the hell, it is like glory to me when something i had never done
> before works well.
>
> regards.
>
>
> --
> ---
> zz [MX]
> cuasi-musico,semi-poeta y loco
>
>
> "Tom Ogilvy" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>>I wouldn't be too concerned about "all the spam". I have been posting
>>here for 9 years using an unprotected email address and wouldn't consider
>>the amount of SPAM I get to be any big deal.
>>
>> Using a public variable is pretty standard fare. Unfortunately, you made
>> it sound like you had a major discovery.
>>
>> but thanks for posting your solution! - I am sure it will be useful for
>> many.
>>
>> --
>> Regards,
>> Tom Ogilvy
>>
>>
>> "zz" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> well, thanks for all the spam i will get.[ no hard feelings]
>>>
>>>
>>> i am completely sorry if that was the impression i caused, of course i
>>> do not mean breaking the spirit of the group, no, sorry again.
>>>
>>>
>>> Bad zz !! bad zz !!, no cookies for you tonight!!!
>>>
>>>
>>>
>>> so for my redemption.
>>>
>>>
>>> '// i know it has some 'scratches' and it could have been a little bit
>>> more effective, but i'm under a little pressure to finish this '//before
>>> xmas and as long as it works...
>>>
>>>
>>>
>>>
>>> in a regular module called msgs i declared this function
>>>
>>>
>>>
>>> Public returnanswer As Integer ' ///this is a global variable that can
>>> be set from Frmmsg's events
>>>
>>> Public Function Messagebox(Msg As String, Title As String, typeofmsg As
>>> Integer) As String
>>>
>>> On Error GoTo errhandler
>>>
>>> Load Frmmsg '// this loads the userform that 'acts' as the msgbox but
>>> doesn't show it yet
>>>
>>> Frmmsg.lblmsg.Caption = Msg '// places the message
>>>
>>> Frmmsg.Caption = Title ' // sets the title ,obviously
>>>
>>>
>>> Select Case typeofmsg
>>> Case Is = 1
>>> Frmmsg.typeofmsj.Picture =
>>> LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgwarn.jpg") '//
>>> show the 'yellow message sphere
>>>
>>> Case Is = 2
>>> Frmmsg.typeofmsj.Picture =
>>> LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgerr.jpg") '//
>>> show the
>>> ' red sphere pic
>>>
>>> Case Is = 3
>>> Frmmsg.typeofmsj.Picture =
>>> LoadPicture("R:\Trainbox\Tbxclient\resources\Images\Msgsuccess.jpg") '//
>>> show
>>> 'the green sphere pic
>>>
>>> End Select
>>>
>>> Frmmsg.Show
>>>
>>> '// this part is for the Messagebox to return a value
>>> that can be handled like the VByes response in a regular msgbox
>>>
>>> Select Case msgs.returnanswer
>>>
>>> Case Is = 1
>>> Messagebox= "TByes"
>>> Case Is = 2
>>> Messagebox = "TBNot"
>>> Case Is = 3
>>> Messagebox = "TBcancel"
>>> End Select
>>>
>>> errhandler:
>>> Err.Clear
>>> End Function
>>>
>>>
>>>
>>> Now
>>>
>>>
>>> in the Frmmsg i have three buttons one for yes, another for no and a
>>> third for cancel
>>>
>>>
>>>
>>>
>>> private sub Btntbyes_onclick
>>>
>>> msgs.returnanswer=1 '// this is for the Messagebox function to return
>>> "TByes"
>>>
>>> unload frmmsg '// cause we don't need the msg anymore
>>>
>>> end sub
>>>
>>>
>>> private sub Btntbnot_onclick
>>>
>>> msgs.returnanswer=2 '// this is for the Messagebox function to return
>>> "TBno"
>>>
>>> unload frmmsg '// cause we don't need the msg anymore
>>>
>>> end sub
>>>
>>> private sub Btntbcancel_onclick
>>>
>>> msgs.returnanswer=3 '// this is for the Messagebox function to return
>>> "TBcancel"
>>>
>>> unload frmmsg '// cause we don't need the msg anymore
>>>
>>> end sub
>>>
>>>
>>>
>>> so now i can write
>>>
>>>
>>> X= Messagebox("Wow " & application.username & " you're handsome!! " &
>>> VbCrlf & " am i right?" ,"Self esteem enhancer",3)
>>> if x="TByes"
>>> then
>>> Messagebox "Liar!!!!","Go back to work",2
>>> else
>>> Messagebox "c'mon!, you know youre not but i still like you the best
>>> "," Please return to your activities",3
>>> endif
>>>
>>> actually this is not the purpose for what i use it, but i tought this
>>> would be funnier.
>>>
>>>
>>> Best regards, hope it may be usefull.
>>>
>>>
>>> --
>>> :=)
>>> ---
>>> zz [MX]
>>> cuasi-musico,semi-poeta y loco
>>>
>>>
>>>
>>> "Tom Ogilvy" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> You mean if I was reading this thread and I wanted to find out the
>>>> solution, I would need to send an email to
>>>>
>>>>
>>>> (E-Mail Removed)
>>>>
>>>>
>>>> Doesn't seem like that is in the spirit of the newsgroup?
>>>>
>>>> --
>>>> Regards,
>>>> Tom Ogilvy
>>>>
>>>>
>>>>
>>>> "zz" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> thanks for the reply but i have already figured it out !!!...
>>>>>
>>>>> if anybody wants to know how send me an email to
>>>>> Jarious[dot]com[at]gmail[dot]com
>>>>>
>>>>>
>>>>> --
>>>>> ---
>>>>> zz [MX]
>>>>> cuasi-musico,semi-poeta y loco
>>>>>
>>>>> "Simon Lloyd" <(E-Mail Removed)>
>>>>> wrote in message
>>>>> news:(E-Mail Removed)...
>>>>>>
>>>>>> Hi not sure entirely what you want to do but this is how to make use
>>>>>> of
>>>>>> Yes, No and Cancel from a message box:
>>>>>>
>>>>>>
>>>>>> Code:
>>>>>> --------------------
>>>>>> Sub Mbox()
>>>>>> Select Case MsgBox("What Now", vbYesNoCancel, "Decision Maker")
>>>>>> Case vbYes
>>>>>> MsgBox "Good"
>>>>>> Case vbNo
>>>>>> MsgBox "Bad"
>>>>>> Case vbCancel
>>>>>> MsgBox "Ugly"
>>>>>> End Select
>>>>>>
>>>>>> End Sub
>>>>>> --------------------
>>>>>> Hope this helps,
>>>>>> Regards,
>>>>>> Simon
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Simon Lloyd
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MsgBox Assistance Needed beavetoots Microsoft Access 3 6th May 2009 04:11 PM
Msgbox needed for search with no results =?Utf-8?B?THluZHN5Sm8=?= Microsoft Access Database Table Design 4 28th Aug 2006 05:49 PM
More help needed re form & msgbox Pam Field Microsoft Excel Discussion 3 22nd Jul 2006 01:05 PM
Simple Msgbox needed johncassell Microsoft Excel Programming 2 24th Feb 2006 05:57 PM
help needed with msgbox Marcus Bischoff \(AnW/P-AB9\) Microsoft Excel Programming 3 29th Jun 2004 01:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:32 AM.