If statement at open of Form?

L

Liz

Access 2007. I have an inventory database with a form for inventory
disposal. The status field lists each item as current or disposed. When a
user types in the asset number of the item, I would like to see one of two
things happen:

If the item status is "disposed": a message box saying that the item has
already been disposed of.

If the item is status is "current": open the Inventory Disposal form.

How do I make this happen?

Thanks
 
A

Albert D. Kallal

if the forms on-open event, you could go:

if me.Status = "disposed" then
msgbox "The item has been already disposed"
Cancel = true
end if


The above code will set cancel = true in the form disposal, and cancel =
true will prevent the form from loading....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top