Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / February 2007

Tip: Looking for answers? Try searching our database.

subforms!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chloe - 26 Feb 2007 12:44 GMT
i have a employee form and a subform with training info info on...the trouble
im having is being able to add more than one traning record for each
employee, i.e. each employee will have up to 30 training record.
i keep getting a message which basically says i cant add more than one
record becuase of the employeeID,
can anyone hlp me please?!!!!!
Wayne-I-M - 26 Feb 2007 13:11 GMT
Hi Chole

Create a new table to hold the training details.  Link this to the employee
table.

tblEmployee
EmployeeID
Emp1stName
EmpSurname
EmpDept
etc
etc

tblTraining
TrainingID
EmployeeID
TrnDate
TrnLocation
TrnQualificationGained
etc
etc

Create the main form from the employee table and the subform from the
tblTraining.  Link the 2 forms with the EmployeeIF field

Hope this helps

Signature

Wayne
Manchester, England.

> i have a employee form and a subform with training info info on...the trouble
> im having is being able to add more than one traning record for each
> employee, i.e. each employee will have up to 30 training record.
> i keep getting a message which basically says i cant add more than one
> record becuase of the employeeID,
> can anyone hlp me please?!!!!!
Van T. Dinh - 26 Feb 2007 13:17 GMT
Could you post your Table Structure for the Tables being used as the
RecordSources of the Form / Subform combination, especially the details of
PK, FK and unique index.

Without seeing the database, I can only guess that something such as PK or
unique index prevents you from adding multiple Child Records ...

Signature

HTH
Van T. Dinh
MVP (Access)

>i have a employee form and a subform with training info info on...the
>trouble
[quoted text clipped - 3 lines]
> record becuase of the employeeID,
> can anyone hlp me please?!!!!!
Chloe - 26 Feb 2007 13:46 GMT
i have an employees table;

employeeID
firstname
lastname
address...
..........

and an training table;
employeeID
course
date
location
cost...
....

i then have a main form with all the employee's details on it, and on that a
subform(training)
Wayne-I-M - 26 Feb 2007 13:53 GMT
Hi

It should be OK then.

Can you open the subform alone and insert records ?

Signature

Wayne
Manchester, England.

> i have an employees table;
>
[quoted text clipped - 14 lines]
> i then have a main form with all the employee's details on it, and on that a
> subform(training)
Chloe - 26 Feb 2007 13:57 GMT
yep, i can add one record for each employee, but no more than that!

> Hi
>
[quoted text clipped - 20 lines]
> > i then have a main form with all the employee's details on it, and on that a
> > subform(training)
Chloe - 26 Feb 2007 14:24 GMT
hey! no problem! i've seemed to have fixed it! for now! not sure how, but i
am now able to input many records for each employee!!! thanks very much for
your help!!!!!!!
Wayne-I-M - 26 Feb 2007 14:41 GMT
Hi

It's sometime a bad idea for things to just start working without the
developer knowing why ??  Oh well - good luck with your project.

Signature

Wayne
Manchester, England.

> hey! no problem! i've seemed to have fixed it! for now! not sure how, but i
> am now able to input many records for each employee!!! thanks very much for
> your help!!!!!!!
John W. Vinson - 26 Feb 2007 17:17 GMT
>hey! no problem! i've seemed to have fixed it! for now! not sure how, but i
>am now able to input many records for each employee!!! thanks very much for
>your help!!!!!!!

It sounds like you (incorrectly) had the EmployeeID set as the Primary
key of your training table. Since the training table can have many
records, it must use the employeeID as a nonunique foreign key.

            John W. Vinson [MVP]
Chloe - 27 Feb 2007 12:24 GMT
yep, you're absolutely right! after thinking about it i realised that the
employeeID cant be the primary key if i wanna add multiple records for each
employee!! thank you to everyone for their advise!!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.