using data from open form to new form

zonda

New member
Local time
Today, 01:39
Joined
Feb 22, 2015
Messages
1
here is what i try to do:
i have a form with automatic ID, i open new form and want this ID
to be in a the new form's field , and when i add data in new form , that this data will be written in the table.
when i use this command:=([Forms]![Field]!
)
it shows the ID number in the new form, but when i click add data it add all input but the ID nuber.
i hope you understand the situation ,what sould i do?
thanks!
 
What you want in the second form is called a foreign key. The two forms should look like this, PersonID, FirstName, LastName, EmployerID. The person id is the primary key and set as autonumber, the EmployerID is a foreign key and set as Long Integer. Now the other table, EmployerID, FullName, Address, etc. The employer id is set as autonumber and the person table can now store the ID number of the employer. The easiest way to transfer the value is to make a combo box on the person form with the row source of the combo the employer table. Now whatever company they select, the PK from employer is stored as a FK in the person table. Lacking any specifics in your post, I hope my example will help. Good Luck.
 

Users who are viewing this thread

Back
Top Bottom