Ok button on msgbox

  • Thread starter Thread starter Ketaki
  • Start date Start date
K

Ketaki

Hi,

In my MS Access-VB code, I want to throw a msgbox, but not
show the "OK" button on that msgbox. what can i do?

Thanks,
Ketaki
 
In my MS Access-VB code, I want to throw a msgbox, but not
show the "OK" button on that msgbox. what can i do?

You can define what buttons will appear on your messagebox by passing the
appropriate intrinsic constant (or its equivalent value) to the "Button"
argument of the MsgBox() function. Some examples are:

vbOkOnly - Displays Ok button
vbOkCancel - Displays Ok and Cancel buttons
vbYesNo - Displays Yes and No buttons
vbYesNoCancel - Displays Yes, No, and Cancel buttons

One would decide which buttons to display on the messagebox based on the context
of the message (obviously, you would need to provide more than an 'Ok' button to
respond to a question that requires a 'Yes' or 'No' answer) and the desired
return value. Is this what you are looking for?
 
no actually i dont want a single button to appear on the
msgbox, not even an OK button. i just want to convey a
message to the user through the msgbox.

Thanks,
Ketaki
 
no actually i dont want a single button to appear on the
msgbox, not even an OK button. i just want to convey a
message to the user through the msgbox.

I don't understand why you don't want the OK button on the MsgBox. It simply
offers the user an obvious method to close the MsgBox when they're done reading
the message. If you don't want any button - simply create your own form for
displaying your messages (just make sure to leave the "Close" box at the right
of the caption bar to allow closing). The MsgBox can't be displayed with *no*
button.
 
Back
Top