|
-
Jan 13th, 2006, 09:09 AM
#1
Thread Starter
Addicted Member
Help please with MsgBox..
Dear Experts,
What code should be added in order my codes run as follow:
VB Code:
MsgBox "Item has been updated.", vbOKOnly, "Update Success"
If vbOKOnly ?????? Then
TextBox3.Text = rst.Fields("Qty")
End If
I give ???? because I dont know what should I type in order after press "OK" then it will show on the text box number .i.e. 3....
Please let me know...
Thanks very much
Jennifer
-
Jan 13th, 2006, 09:17 AM
#2
Addicted Member
Re: Help please with MsgBox..
If you have vbOKOnly there is no need for an If, because the MsgBox will always return vbOK. If you need to get a yes/no answer you will have to change the parameter in MsgBox to vbYesNo.
VB Code:
Dim Res as vbMsgBoxResult
Res=MsgBox("Question?", vbYesNo, "Title")
If Res = vbYes Then
'Do something
End If
-
Jan 13th, 2006, 09:18 AM
#3
Re: Help please with MsgBox..
Since there is only one button on the message box, you don't need any kind of IF statement. Just put your textbox.text line right below the msgbox line.
-
Jan 13th, 2006, 09:23 AM
#4
Re: Help please with MsgBox..
I don't know what you are trying to do exactly, but looking at your post you may want to think about using a Message Box with the Yes/No buttons like in Bregalad's post and putting you your function inside of the IF-Then Statement.
Just my two cents.
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Jan 13th, 2006, 09:37 AM
#5
Lively Member
Re: Help please with MsgBox..
or... you can use the if-then statements before the condition you posted and after posting the message box post the action
VB Code:
if item is updated then (or if not 'error then)
msgbox "item updated"
textbox3.text = rst.fields("Qty")
else
'counter condition
end if
-
Jan 13th, 2006, 10:12 AM
#6
Thread Starter
Addicted Member
Re: Help please with MsgBox..
Hi,
I have already tried that codes but still does not work...do you want me to show you the whole codes...so, you can have a look what is going on...????
-
Jan 13th, 2006, 10:14 AM
#7
Re: Help please with MsgBox..
 Originally Posted by zach007
Hi,
I have already tried that codes but still does not work...do you want me to show you the whole codes...so, you can have a look what is going on...???? 
Yes.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|