shopping basket (1 Viewer)

nobby

Nobby
Local time
Today, 01:35
Joined
Dec 28, 2008
Messages
24
Hi All
I am at the end of a very long journey with a database I promised I would help with.
Effectively, the salesperson looks up a product from a lookup list, this info goes to a temporary table(Basket)(to protect price rises in the lookup table affecting the customers invoice), where quantities, discounts etc are added, the customer agrees to these quantities\prices and the basket is added to thier invoice
So. the client invoice is on frminvoice and his purchases go onto its subform Frminvoicesub.
The basket is FrmMain and the subform is FrmTempSub

This will transfer the fields on record 1 from the basket to the customer invoice
Forms!FrmInvoice.Form.FrmInvoiceSub.Form.Make = Forms!frmmain!FrmTempSub.Form.Make
Forms!FrmInvoice.Form.FrmInvoiceSub.Form.PrinterNo = Forms!frmmain!FrmTempSub.Form.PrinterNo
Forms!FrmInvoice.Form.FrmInvoiceSub.Form.Cartridge = Forms!frmmain!FrmTempSub.Form.Cartridge
Forms!FrmInvoice.Form.FrmInvoiceSub.Form.Yeild = Forms!frmmain!FrmTempSub.Form.Yeild
Forms!FrmInvoice.Form.FrmInvoiceSub.Form.Cost = Forms!frmmain!FrmTempSub.Form.Cost
Forms!FrmInvoice.Form.FrmInvoiceSub.Form.Item = Forms!frmmain!FrmTempSub.Form.Item
Forms!FrmInvoice.Form.FrmInvoiceSub.Form.Colour = Forms!frmmain!FrmTempSub.Form.Colour
Forms!FrmInvoice.Form.FrmInvoiceSub.Form.capacity = Forms!frmmain!FrmTempSub.Form.capacity
Forms!FrmInvoice.Form.FrmInvoiceSub.Form.Notes = Forms!frmmain!FrmTempSub.Form.Notes
Forms!FrmInvoice.Form.FrmInvoiceSub.Form.discount = Forms!frmmain!FrmTempSub.Form.discount
Forms!FrmInvoice.Form.FrmInvoiceSub.Form.Qty = Forms!frmmain!FrmTempSub.Form.Qty
Forms!FrmInvoice.Form.FrmInvoiceSub.Form.Prevat = Forms!frmmain!FrmTempSub.Form.Prevat

I need to run this through Until all the items in the frmtempsub have been copied (or better still cut and pasted) to the customer invoice.
I know I will need do while eof inthere somewhere and possibly Dim rs As dao.Recordset
Set rs = Me.RecordsetClone
Because thats what I am seeing on the examples I see
Many Thanks
 

JHB

Have been here a while
Local time
Today, 02:35
Joined
Jun 17, 2012
Messages
7,732
Why not add the data from temporary table to the "client invoice" table, using an append query?
 

nobby

Nobby
Local time
Today, 01:35
Joined
Dec 28, 2008
Messages
24
Hi JHB and thanks for your reply.

Yes, that's what I thought, however, this works and fills the table (TblTemp) correctly but I cant show the result in the sub form, It appears to be locked and only shows the ID as NEW. (Waiting for data entry before it issues an ID Number
I have tried removing the ID number, and still nothing.

I can copy the record from Forms!FrmInvoice.Form.FrmInvoiceSub and paste it into Forms!frmmain!FrmTempSub which works fine except
I need to select only some of the records in Forms!FrmInvoice.Form.FrmInvoiceSub to go to the Forms!frmmain!FrmTempSub and its a bit messy

Thanks again for your reply
 

TJPoorman

Registered User.
Local time
, 18:35
Joined
Jul 23, 2013
Messages
402
2 things come to mind: Either you have your subform set to dataentry, which will make it so no previous records show. Or you simply need to requery your subform after the append query.
 

JHB

Have been here a while
Local time
Today, 02:35
Joined
Jun 17, 2012
Messages
7,732
I can copy the record from Forms!FrmInvoice.Form.FrmInvoiceSub and paste it into Forms!frmmain!FrmTempSub which works fine except
I need to select only some of the records in Forms!FrmInvoice.Form.FrmInvoiceSub to go to the Forms!frmmain!FrmTempSub and its a bit messy

Thanks again for your reply
Hmm - looking at code and reading your description in post #1, you are copy from the Forms!frmmain!FrmTempSub to the Forms!FrmInvoice.Form.FrmInvoiceSub, but both ways work with an append query. You can add some criteria to the query.
Like TJPoorman said, dataentry or requery.
 

Users who are viewing this thread

Top Bottom