linked ID fields in multiple forms change when passed to the table! help please

nattylou

New member
Local time
Today, 05:46
Joined
Sep 16, 2007
Messages
4
I have created a database with one table and multiple forms. My ID field (Primary key and autonumber) appears on every form.

The value chosen on the main form determines which form is opened next. This is done with a conditional macro that is set to OpenForm.

The secondary form that opens receives the ID# from the main form. My control source seems to be set correctly. The ID# appears correctly in the field on the form.

The problem occurs when the forms are closed and the data is sent to the table. The table creates a new ID# for each form that I had opened. So, the data from the main form A goes into a record with ID# 1, the data from the second form B goes into a new record with ID# 2 (even though the ID# on form shows up on the form as 1).

Even if I dont close the forms, but just refresh them, the problem occurs.

Any advice on where I might have gone wrong? Why is my form ID data changing to the next autonumber when entered into the table?

Thanks
 
Your problem doesn't make any sense. You are probably using bound forms?
Without seeing the database i can only say: Use unbound forms.

if you don't want to do that, compact and zip the database or a subset and post it.

HTH :D
 
Your thinking way to hard, it damages your brains. You have to go back to the basics and then think logic the answere you seek is less complicated than you discribe on this point.

Good luck
 
if you only have one table, then you are probably saving to the same table, creating separate records. i doesn't seem to make sense to open separate forms for one table.
 
I also question your design but you can stop the second and third forms from creating new records by opening them to the record from the first form. First of all, you need to save the current record before you open the new forms:
DoCmd.RunCommand acCmdSaveRecord
Then you can use the where argument of the OpenForm method to pass the primary key of the record from form1 to form2 or form3.
 

Users who are viewing this thread

Back
Top Bottom