Moving info from form to form

  • Thread starter Thread starter Cathy
  • Start date Start date
C

Cathy

I have several forms that feed a 'dispute process' form.
I'm trying to devise a way so I know which form the
original information came from.

What I have tried so far is... I have put a code on the
original forms (ie 1,2,3). This information is passed to
a corresponding field on the dispute form. If the text
box on the dispute form has '#Name?', then I know it was
not the one passing the information. I want to write
something that recognizes the valid text box and moves
that information forward.

When I use iif(text1=1,1,iif(text2=2,2,iif(... it only
returns valid data if the true statement is in the first
position. If the true statement is in the second position
or later, it produces an error. How can I either make the
fields tied to the closed forms something other
than '#Name?' or make the iif statement recognize
the '#Name?' as something other than an error?

Any suggestions you have will be appreciated... even if
it's a totally different approach!

Thanks,
Cathy
 
Cathy,

It may help you to recognise that forms do not have
fields/data/information, so forms can therefore not pass information
to another form. All forms can do is *display* information which is
ultimately in tables.

Therefore, if you want one form to display something about which form
was used to originally enter the data, then the data entered (in the
table) needs to record an indicator regarding the entry form.

So, I would tackle it like this... Add a new field to the table, for
FormUsed. Make it an appropriate data type, depending on whether you
want to identify the forms by 1, 2, 3 or by "A", "B", "C" or the names
of the forms or whatever. Include this field in the recordsource of
all the "several" forms, and represent it on the form with a textbox,
but maybe you don't necessarily want to show it so you can set its
Visible property to No. And then set its DefaultValue property to
whatever you want to be recorded as the identifier for that form. And
then, you can also include this field in a control on the Dispute
Process form, so it will show the form used for entry without you
needing to do anything else.

- Steve Schapel, Microsoft Access MVP
 
Back
Top