Stop subform opening on its own

  • Thread starter Thread starter Piers 2k
  • Start date Start date
P

Piers 2k

Hi folks,

Am trying to put a piece of code into a form load, so if it is not within
another form as a subform, it will display a message and cancel the event.
ie The user has double-clicked the form themselves.

Any idea how to test for this?

TIA,
Piers
 
In the Open event of the form, check for the value Me.Parent.Name. If you
get error 2452, then there is no parent form, Cancel the open. If you get a
text string back, then you have a parent form.
 

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

Back
Top