How to Autofill Company Info in Employee Form by pressing button

Quinten

New member
Local time
Today, 11:04
Joined
Sep 23, 2005
Messages
6
Hi there,

I am stuck for over a week now, and tried just about everything I am capable off ...

I have two forms: COMP (where I fill in fields for Company Table) and PERS (where I fill in fields for Person Table).
On the COMP-Form I have a button, named: 'Add Person/Employee to Current Company'.

The two tables (Company and Person) are linked by PK - FK (PK_CompanyID & FK_EmployedAtID).

I can't get it to work properly.
The PERS-form must be filled with the company info I filled in the form COMP, after I press the button.
But the PERS-form also must be filled out normally (not via COMP, but seperately), choosing the company in the comboboxfield 'Company Name' on the PERS-form. Do you stick with me?

So I want to start the PERS-form with the filled in company Info by pressing the button.
And I want to be able to start the Form seperately (which I can off course) and choose the company myself , by selecting the right company in the combobox.

I have a attachment sent with this.

Can someone look at this for me, and explain what I am doing wrong.

I tried to do it with a autofill macro, and with some code ...

I just don't seem to get it right.

Thanx in advance for all the help,

Quinten
 

Attachments

Last edited:
First you have some normalization issues with your database. Whenever you have fields like genre1 and 2, you have a repeating group. These should be put into a join table that has FKs for the parent record and the Genre.

Second, its a good idea to name your FKs the same as PK name. this makes it easy to spot your relations.

Third, what you should have is a subform on Pers that is bound to the COMP table and linked on the CompanyID. When the companyID is filled in the subform will show the company info.
 

Users who are viewing this thread

Back
Top Bottom