Message Box On Exit With Yes And No Option??

lakattack

Registered User.
Local time
Today, 21:31
Joined
Apr 17, 2007
Messages
35
Hey,

I would like to know how I would go about putting a message box with a yes and no option on it. On my database form I have a subform inside it in which has a tabular form on it and basically on one of the tabs if it does not have say despatched then on exit a message box should say 'There are still orders to be invoiced' Are you sure you want to exit?' (thats where the yes and option should come up) with yes the form closes and no it stays on the form

Any sort of help would be much appriciated.

Thanks
 
Type in "msgbox" and find it in the Access help, that does this and more for you (with some additional coding.

Post back and let us know how you got on, or post any additional questions you have.
 
Code:
if msgbox("do you want to do this",vbyesno) = vbno then
  do whatever
else
  do whatever
end if

note there are a whole load of options in the vbyesno parameter

eg
vbyesno
vbokcancel
vbyesnocancel

you can add a defaultoption
vbyesno+vbdefaultbutton2

you can add a small graphic
vbyesno+vbdefaultbutton2+vbcritical
vbyesno+vbdefaultbutton2+vbquestion

look at help for more info
 
Type in "msgbox" and find it in the Access help, that does this and more for you (with some additional coding.

Post back and let us know how you got on, or post any additional questions you have.

The message box is fine coming up when I want but it needs to check the status in my tabular sumform. If it does say 'Despatched' then it should close but if not the message box with the yes and option (which I have done)

Subform tabular name: TabCtl78
tab name: StatusHistoryPage
entity (that needs to be checked): OrderStatus

I have looked on Access and it does not state anything on validation within tabular subforms

Any help would be appriciated

Thanks
 
Nope a textbox is a text box, it only texts.. nothing more..
You need to do some coding before the textbox

To give you an idea... Something like so...
Code:
If Somethign = 1 then 
    msgbox "its 1"
else
    msgbox "its something else"
endif

Edit
There is no difference between checking a tabular or columnar form. You always get the data from the active record...
 

Users who are viewing this thread

Back
Top Bottom