[AccessD] Same form, different actions

Mike & Doris Manning mikedorism at verizon.net
Thu Jan 26 15:20:44 CST 2006


I've done what you are asking several times.  I just pass in an OpenArgument
at the end of my DoCmd.Open statement.  I save that to an internal form
variable in the FormOpen event and check it on FormClose.

Doris Manning
mikedorism at verizon.net

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Clark
Sent: Thursday, January 26, 2006 3:24 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] Same form, different actions

First, I've started two requests for help over the past couple of days,
only to discover the problem, while actually typing the Emails...see,
y'all have learned me some things, since I've been hanging out here.

Well, it appears my luck may have run out. Actually, I can think of a
couple different ways to do what I am now trying to do, but I want to do
it correctly...something else I've learned here...so I want to run it by
the list members.

First I'll give you a little background on the program, which is being
written in A2K. It is a case tracking program for our DA's office, and I
have chosen to lump all names together (i.e. lawyers, defendants,
victims, judges, etc.) in a single table and, using checkboxes,
designate what role(s) they fulfill. The purpose of doing this was to
avoid missing people already in the system, in another designation than
they are currently being entered as. It is usefull for them to know if a
defendant has been a victim, or visa versa, and theoratically, a name
can be in the system as all of these designations. I used the scenario
of an ADA, who becomes a defense attorney, then become a judge, then
they are mugged, thus becoming a victim, which makes them lose it and
take revenge on their attacker, which makes them a defendant...they
would then be in all categories...unlikely but possible.

So, I've got a form called frm_Subjects, which allows entry of names
and their "designations." The main form of the program is the form,
"frmIndictments" and on this form, which basically a case by case entry,
there is a drop down box to choose a defendant, from a list of names.
Using a union query, I have set the top option to be, "<ENTER NAME>".
When they choose this option, I want to take them to the "frm_Subjects"
form. OK, I'm good up to this point.

The problem is however, can I use this same form, yet have it react
differently? For instance, I've already got it opening up as an "entry
form" with the way I am calling it from the parent form (i.e.
"DoCmd.OpenForm "frm_Subjects", acNormal, , , acFormAdd,
acWindowNormal"). But, when I exit that form it returns to the menu, as
I've told it to do, and as I normally would want it to do. But, when it
is accessed via the other form, I want it to return to that form, and
place the chosen name into the combo box, which is bound to the table.

The possibilites I've thought of so far are:

1) set up a parameter in the On Open event of that form...I don't even
know if this is possible, now that I'm thinking about it...and check for
this when I have it do things. Maybe it defaults to a "0" and works the
way it is now working, but if called from the other form, it gets a "1"
and does things slightly different.

or 2) Cut my losses and just make a copy of the form and have this copy
do the different actions, and call this one from the other form. I'm
guessing this will be the answer.

Thank you!

John W Clark
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list