linking subforms to main form

G

Guest

I have created a master form (EventMaster) which includes two subforms
(supervisorreview & customer). I also have 10 tab controls attached to the
master form; each tab contains a subform which captures employee data (up to
10 employees; 1 employee per tab). There will always be data entered for the
EventMaster, SupervisorReview, Customer, and at least 1 (but up to 10)
Employee. The EventMaster, SupervisorReview, Customer, Employee1, Employee2,
Employee3, etc. are separate tables. Since an event number could be used
more than once, I have used Event Number and created an autonumber ID field
to be used as the primary keys. Each table contains an autonumber ID field
as well as event number. I have defined the subforms to link child fields
and link master fields according to the autonumber ID & Event Number fields.
The records seem to be linking properly for the master, supervisorreview, and
customer, but I have a problem with the employee tabs.
The event, supervisorreview, and customer information is entered, followed
by information for at least one employee record. Not every record will have
more than one employee record, but when I need to go to Employee2 tab and
enter information, I receive the message :YOU CAN'T ASSIGN A VALUE TO THIS
OBJECT. I am still able to continue entering data and it seems to be saving
properly. That's one problem. My greater concern is that for those records
that require information to be entered up to several employees, the
autonumber ID does not match up. This makes sense in that if the first 5
records entered only contain 1 employee, the autonumber will be 5; but when I
go to enter the first record that requires me to enter information for
employee2, then the autonumber for employee1 is 6 and the autonumber for
employee 2 is only 1. Help! I need to be able to maintain referential
integrity and retrieve the data as one record. How do I fix this?
 
G

Guest

You only talked about forms, subforms, and tabs. What tables are the tabs
bound to? Seems that you need Employee table with primary key to be linked
to another table to capture the tab information. This other table would have
a foreign key related to the primary key of the employee table.
 
G

Guest

Thank you for your response. Each tab is bound to an Employee form whose
source is a table (tab 1 bound to Employee1subform (source is employee1
table), tab 2 bound to Employee2 subform (source is employee2 table), etc.
When I try to set the link child fields;link master fields properties from
the Employee or Event Master tables, the entry is not saved and I don't know
why. Should I not be using subforms and rather just use the bound table
fields? The subforms that I'm using link the Event Master table to the
Employee table via the autonumber ID and EventNumber (both fields are in each
table). The link master fields for the employee subforms are
EventID;EventNumber and the link child records are
(EmployeeID;EmployeeEventNumber).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top