View Full Version : copy data between forms


Ela
04-19-2002, 10:34 AM
Hi!

I have the following problem.

I have a main form with two comboboxes.
The first combobox shows all "PI person".
The second combobox shows all "Contact person". Both are runing on queries.

A the same main form I have two buttons, which opens the subform "PI person" or "Contact person" respectively, so I can edit information about each person.

I would like to have a 'copy' button. After clicking on the button, it will copy the name from 'PI person' table to the "Contact person" table in case they are the same.

Can anyone point on the right direction how to solve this.

Thanks in advance,
E.

Jack Cowley
04-19-2002, 10:51 AM
Create an Append query and run it with your command button.

Ela
04-19-2002, 11:36 AM
Hi Jack!

Thank you for advice, but could you explain it to me in more details.

I have made an append query and run it with the button, but how to set a criteria to append only one record from "PI person" table (selected from the first combobox) to "Contact person" table. How to make appear the copied name not only on the dorp down of the combobox , but also in the selected text part of the combo box.

Thanks,
E.

Pat Hartman
04-19-2002, 11:47 AM
People are people and therefore both contact person and PI person should be stored in the same table. If a person may have only one role, ie be EITHER a Contact person OR a PI person but NOT BOTH, then you can store a code in the person table indicating what type of person this is. If a person can fill multiple roles, then the person table has a one to many relationship with role and that means that role mult be stored in a second table. You can use queries that filter the combo boxes so that you can restrict the people in the list to one type or another.

This method permits you to keep a single record for an individual so if that person's name or contact information changes, you have only ONE record that needs to be changed rather than the two you presently have.

Ela
04-23-2002, 05:23 AM
Hello!

Thank you Pat. I will redesign the DB.
E.