calculate, insert and append

C

cporter

I'm thinking I need to generate a table field (PMTemp.wono) by finding
the last record in another table (WO), adding one to the field of
interest and inserting that number into the table record. That record
then needs to be appended into WO. Any suggestions on how to start?


Right now I am using a query to generate a table, PMTemp. I then
condense the
information with another query to generate a temporary table PMWO. I
then take the condensed information and append it to another table,
Workord. The Wordord table has an autonumber field, WONO, that I need
to relate back to records in PMTemp in a one to many relationship.
There are several procedures (ProcNo) for each MachID but there will be
only one workorder for that MachID. I've tried the three options on the
edit join dialog and the query returns to many records. I'm thinking if
I also append the autonumber field PMWO.ID then the next time the
temporary table regenerates the
workorders will be linked to the wrong data. That's why I'm thinking I
need to fill the table field PMWO.wono by code.

Table PMTemp (flagact is generally null)

MACHID DESC1 DESC2 FREQ DLP FLAGACT WONO RECORDNO
PROCNO PROCFLAG
ASC-130 PM PM 31 10-Mar-06 65700 1554
28 TRUE
ASC-130 PM PM 31 10-Mar-06 65700 1555
29 TRUE
ASC-130 PM PM 7 31-Mar-06 65700 1558
32 TRUE
ASC-130 PM PM 7 31-Mar-06 65700 1559
33 TRUE
ASP-137 PM PM 180 05-Oct-05 65704 1564
43 TRUE
PLE-004 PM PM 7 30-Mar-06 65737 1574
1 TRUE
PLE-004 PM PM 7 30-Mar-06 65737 1575
2 TRUE
PLE-004 PM PM 7 30-Mar-06 65737 1576
3 TRUE
PLE-004 PM PM 7 30-Mar-06 65737 1577
4 TRUE
PLE-004 PM PM 7 30-Mar-06 65737 1578
5 TRUE
PLE-004 PM PM 7 30-Mar-06 65737 1579
6 TRUE
PLE-004 PM PM 7 30-Mar-06 65737 1580
7 TRUE
PLE-004 PM PM 30 08-Mar-06 65737 1581
8 TRUE

I then use another query to condense that information by machid and
prepare it to be appended to another table.

tblPMWO

MACHID Action Request1 ID
ACS-215 PM PM 1
AMS-152 PM PM 2
APT-006 PM PM 3
ASC-059 PM PM 4
ASC-071 PM PM 5
ASC-103 PM PM 6
ASC-130 PM PM 7
ASE-121 PM PM 8
ASP-104 PM PM 9
ASP-129 PM PM 10
ASP-137 PM PM 11

This is the table it is appended to.

Table Workord
DAYDOWN DAYUP TIMEDOWN TIMEUP MACHID EMPLOYEE ACTION
REQUEST1 COMMENT1 COMMENT2 WONO THD SUBSYS
06-Apr-06 06-Apr-06 15:15:00 19:30:00 ASP-137
JRE PF repair none none 65761 4.25 STR
06-Apr-06 07-Apr-06 23:45:00 5:00:00 ASP-137 CGF
CO repair none none 65762 5.25 CHD
07-Apr-06 07-Apr-06 4:15:00 5:50:00 ASC-071 CGF CO
repair none none 65763 1.58 CHD
06-Apr-06 12:00:00 ASP-137 SDL PF
repair none none 65764 0 CHD
07-Apr-06 07-Apr-06 6:00:00 6:10:00 ASC-071 SDL PF
repair none none 65765 0.17 CHD
 

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