sub procedure message box help
Can someone help me in getting started with this I need to setup a sub procedure that when called will display a message box. the string variable needs to be a passed value between the calling procedure and the called procedure. I need several different messages box to be displayed some with just ok buttons and some with yes.no buttons. Any information I would greatly appreciate because i'm stuck on this.
thanks,
Michael Giberson
Re: sub procedure message box help
Well i have read through the above replies and indeed they helped alot too. So here is my query, iam displaying the messagebox on the ItemUpdating event of my gridview. The messagebox pops up with three buttons( yes,no,cancel) but clicking ok or cancel just gives me same results i.e when i click cancel, instead of canceling the updating operation, the gridview goes a head and updates even after clicking cancel.
Qn. How do make sure that clicking cancel stops updating the record.
Re: sub procedure message box help
This sounds to me like a school assignment. When you call the messagebox that is more than just an ok button, you should assign it to an integer then test that integer to see which button they pressed:
VB Code:
Dim i As Integer
i = MsgBox("Click Yes to do something, No to Deny or Cancel to Exit")
Select Case i
Case vbYes
'Do Something
Case vbNo
'Do Something
Case vbCancel
'Do Something
End Select
As for stopping the gridview from updating, it has a canceledit method that you can use and will discard all changes and cancel the update. I hope that helps some.
Re: sub procedure message box help
[QUOTE=dminder]This sounds to me like a school assignment. When you call the messagebox that is more than just an ok button, you should assign it to an integer then test that integer to see which button they pressed:
VB Code:
Dim i As Integer
i = MsgBox("Click Yes to do something, No to Deny or Cancel to Exit")
Select Case i
Case vbYes
'Do Something
Case vbNo
'Do Something
Case vbCancel
'Do Something
End Select
As for stopping the gridview from updating, it has a canceledit method that you can use and will discard all changes and cancel the update. I hope that helps some.[Yes this forum is a school and iam learning, real starter or is the forum closed for starters. ]
Re: sub procedure message box help
Yes this forum is a school, isn't it and iam learning, real starter or is the forum closed for starters.
Re: sub procedure message box help
No, the forum is not closed for learning, however most of us who post here do not like to do homework assignments for people. We would rather give them the ability and direction to learn the technologies themselves. There have been a few who have tried to snowball people on here into giving them the entire answer instead of putting in the time and effort most of us have to actually learn.
Anyways, I hope that bit of code I previously posted gets you to where you need. If you run into further problems or errors feel free to post them and we will be glad to be of assisstance.
D
Re: sub procedure message box help
Ok, hope to keep around then, otherwise i was about to step a side and give room for the Gurus .