How to determine by whom "List Items Edit Form" was invoked

G

Guest

Hello,

Using Access 2007, I designed a form ("LogAircraft") with a combo box called
"cbxAircraft". I set the property "List Items Edit Form" of cbxAircraft to
"mgEditMetadata" - a valid form name.

So far so good: In "View" mode, when a user enters text that's not found in
the form, access asks a question and displays the form mgEditMetadata. Also,
when the user clicks the "edit" button Access displays when collapsing the
box, the correct form is shown.

How can I programatically determine in what way mgEditMetadata was opened?
In this example, I would like mgEditMetadata to know that it was opened
because of an event that occured with cbxAircraft. If mgEditMetadata knew
this piece of information, it could programatically decide to display a list
of aircraft to edit - and in a different context, it could decide to display
a list of oils, for example.

I tried OpenArgs which does contain some information that's valuable but
it's not documented.

I hope I'm making sense. Any clues are appreciated!

Cheers,


mamumi
 
J

John W. Vinson

How can I programatically determine in what way mgEditMetadata was opened?
In this example, I would like mgEditMetadata to know that it was opened
because of an event that occured with cbxAircraft. If mgEditMetadata knew
this piece of information, it could programatically decide to display a list
of aircraft to edit - and in a different context, it could decide to display
a list of oils, for example.

I tried OpenArgs which does contain some information that's valuable but
it's not documented.

OpenArgs contains only whatever was passed into it from the calling routine.
That's probably your best way to do this; check every place which calls this
form, and add something distinctive to the OpenArgs argument of the OpenForm
call. Then the form's Open event can check what was passed in OpenArgs to take
appropriate action.

John W. Vinson [MVP]
 

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