linking two forms (2)

A

Andrey

Hi,

I would like Access to automatically copy a unique id from an existing
record in one form to a new record in a linked field within a second form.

I posted this within a previous question but without success/reply, probably
because the thread of the question becomes lost in hyperspace through time.
I'm sure there's a lot of replication out there but how else can a response
be hoped for if a new thread is not created each time someone has a question.
(I'm sure others have come accross this). Guess I'll just keep wading through
each thread, with hope, raising a new thread as a last resort.

However, any help with this would be appreciated. (My knowledge of Visual
Basic is
non-existent so any help of where to incorporate any lines of script would
also be useful).
Cheers. :)
 
A

Al Camp

Andrey,
You didn't explain what you are trying to accomplish with your second
form... so I'm guessing that your trying to establish a relationship between
the data in the 2 forms...

If you have a Primary table with a unique key field (say... tclCustomers
with an autonumber called CustID (the ONE)), and a secondary table
(tblOrders (the MANY)) with a field called CustID (Long Integer), and you
establish a One-to-Many relationship (w/Referential Integrity) between those
2 tables, you don't have to "copy" any CustIDs to the secondary table at
all.

That's handled by the relationship.

You create a Main form based on tblCustomers, and a subform based on
tblOrders, and link them via the CustID field.
Now... whenever you enter an Order against an existing Customer record,
the CustID field will automatically be entered into the CustID field of
Orders. You just enter Order information... the relationship of the tables
and the realtionship of the form link does the CustID "copying" for you.
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 
A

Andrey

Hi there, thanks for the reply, hope you're still out there.

Essentially what I have is two main forms based on two main tables both
having a unique "Case ID" field, linked on a one-to-one relationship. I split
the table because when I created the form it returned an Access message
saying something like "your data will be truncated...". So... having two
tables/forms I now would like to click on a command button and open a new
record within the second form with the Id copied into it's linked 'Case ID'
field from having just created a new unique 'Case ID' and record in the first
form.

Look forward to your/any reply.
Thanks.
 
Top