J
Jaybird
I have a form (frmInvoice) based on table Order Entry5. The primary key for
this is RecordID. These are order records for parts that are to be
processed. Each order has an order number and can have several parts on it.
Each line of the order is uniquely identified by the primary key (RecordID).
On this form I would like to include a subform that is based on the table,
tblInvoice. The records on this table have a relationship that is one to
one with the records on the Order Entry table and the table has the same
primary key (RecordID). However, I would like to group the records based on
the Order Number field, which is a foreign key on both tables. Doing so
allows me to marry up the order details like part number and quantity
(included on the Order Entry table) with the pricing for those parts (from
the table tblInvoice). The problem is that where data doesn't exist for
records in the Order Entry table, I haven't been able to come up with a way
for smoothly creating new records in the tblInvoice table. I toyed with the
idea of using the subform's OnCurrent event to use the same RecordID when the
data doesn't exist, but this produces errors. (BTW, I had to modify the
subform's record source to include the table Order Entry5 in order to make
this work - sortof...) My reasoning was that if the record source query for
the subform produced results for each record on Order Entry and those
matching records from tblInvoice, that I could use the OnCurrent event to
uniquely identify the results of the query. The difficulty of doing this
seemingly simple task has led me to conclude that creating another table for
the pricing information makes no sense. If it is a one to one relationship
with the Order Entry table, then perhaps I should simply add pricing fields
to the Order Entry table? I feel incredibly stupid about this. Can anybody
show me the way around this mess?
Why are you asking me? I dont know what Im doing!
Jaybird
this is RecordID. These are order records for parts that are to be
processed. Each order has an order number and can have several parts on it.
Each line of the order is uniquely identified by the primary key (RecordID).
On this form I would like to include a subform that is based on the table,
tblInvoice. The records on this table have a relationship that is one to
one with the records on the Order Entry table and the table has the same
primary key (RecordID). However, I would like to group the records based on
the Order Number field, which is a foreign key on both tables. Doing so
allows me to marry up the order details like part number and quantity
(included on the Order Entry table) with the pricing for those parts (from
the table tblInvoice). The problem is that where data doesn't exist for
records in the Order Entry table, I haven't been able to come up with a way
for smoothly creating new records in the tblInvoice table. I toyed with the
idea of using the subform's OnCurrent event to use the same RecordID when the
data doesn't exist, but this produces errors. (BTW, I had to modify the
subform's record source to include the table Order Entry5 in order to make
this work - sortof...) My reasoning was that if the record source query for
the subform produced results for each record on Order Entry and those
matching records from tblInvoice, that I could use the OnCurrent event to
uniquely identify the results of the query. The difficulty of doing this
seemingly simple task has led me to conclude that creating another table for
the pricing information makes no sense. If it is a one to one relationship
with the Order Entry table, then perhaps I should simply add pricing fields
to the Order Entry table? I feel incredibly stupid about this. Can anybody
show me the way around this mess?
Why are you asking me? I dont know what Im doing!
Jaybird