PC Review


Reply
Thread Tools Rate Thread

Capture composite PK for input in second and third table

 
 
tbrogdon@gmail.com
Guest
Posts: n/a
 
      21st Jan 2008
I have 3 tables which form the basis for my db:

tblProduction w/ a composite key of ProductionDate, Dept, and Shift.
Every bit of information derived from every query is based on this
composite key.

I also have tblEmployeeProduction w/ ProductionDate, Dept, Shift,
EmployeeID, JobFunction, HoursMachine, and HoursAssembly. This table
is linked to tblProduction on ProductionDate, Dept, and Shift.
Likewise it is indexed and unique on ProductionDate, Dept, Shift, and
EmployeeID. The purpose of this table is to capture the hours worked
in a particular JobFunction per an instance of ProductionDate, Dept,
and Shift so the value of ProductionDate, Dept, and Shift will be
repeated for each employee of that Dept and Shift on any particular
day. Currently I have frmSetEmpHours which is a combination of an
Append query and an Update query to populate the table. This is the
code that runs from the Click event on that form:

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryEmpShiftHours"
DoCmd.OpenQuery "qrySetJFHours"
MsgBox "Employee shift information is updated."
DoCmd.SetWarnings True

This works great so far. However, I have to make an entry in
tblProduction before I utilize frmSetEmpHours or I get a warning
concerning key violations which I understand because of the composite
PK.

On top of that, I have tblProductionOperation which captures the
actual production information related to each employee for every
instance of ProductionDate, Dept, and Shift (i.e., PartID, QtyRun,
etc.).

It seems to me that I should have th user make an intial entry in
tblProduction for ProductionDate, Dept, and Shift from a command
button on a form and ALSO run the code above to prepopulate
tblEmployeeProduction with the default data. Later in the shift, from
a different form (frmInputProdData - bound to tblProductionOperation),
the user inputs production data for the shift. I have a form/subform
to do this already which works great IF the user inputs composite key
data in IT before entering data in tblEmployeeProduction.

In other words, I need to be able to input data into both
tblEmployeeProduction and tblProductionOperation which are both linked
to tblProduction on 3 fields and the data entry will take place at
different times so how do I code the CLick event for two different
forms to allow me to link and return the values from the composite key
of tblProduction to use as input into both tblEmployeeProduction and
tblProductionOperation?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Composite Key and Input JohS Microsoft Access VBA Modules 2 4th Aug 2007 09:28 AM
Looking for a TV Capture card with 2 composite input sets. jeremyje@gmail.com ATI Video Cards 12 7th Oct 2006 02:29 PM
TV Capture card with 2 composite input sets jeremyje@gmail.com ATI Video Cards 0 2nd Oct 2006 07:44 PM
AIW 128 Pro - Need composite capture to keep old files. Joseph ATI Video Cards 0 5th Feb 2004 03:34 PM
ATI AIW8500 DV: Is TV tuner input supposed to be better than composite input? author ATI Video Cards 2 2nd Sep 2003 02:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:54 PM.