Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check to see if a form is active or open 2

Status
Not open for further replies.

Chyld

Programmer
Jul 25, 2001
48
GB
Right, I have a gorgeous database with one hitch.

I have two forms:

'AREA' contains a textbox where a postcode value is entered i.e. HX3 or AB10

the second form 'PRODUCTS' uses the textbox from 'AREA' as criteria in a query and uses the information to extract the name of who looks after that area....

If I press the close button on 'AREA', I want it to check to see if 'PRODUCTS' is active. If 'PRODUCTS' is active, then a message box should announce that fact and cancel the close process until 'PRODUCTS' is closed.

If 'PRODUCTS' isn't active, then the close process should continue as normal...

Any suggestions?

Chyld

craig@chyld.co.uk

The faster rabit raced ahead and lost to the slower Turtle.
 
In Access demo database (nwind.mdb??)there is a module that checks to see if the form is open. Just import this module into your database. It is the isloaded() function. then you can just call it in your on close event

if isloaded("Products") then
msgbox"Products is still open"
docmd.cancelevent
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top