yes I have 2 different tables for Customer table and Orders Table
i make a query name qryOrders
and with a SQL
SELECT tblOrders.CustID, tblCustomer.CustomerName, tblOrders.ItemCode,
tblItem.ItemDescription, tblOrders.Quantity, tblItem.Price, tblItem.Taxrate,
[Quantity]*[Price] AS Amount, [Taxrate]*[Amount] AS TaxableAmt,
[TaxableAmt]+[Amount] AS Total, tblOrders.Date
FROM (tblCustomer INNER JOIN tblOrders ON tblCustomer.CustID =
tblOrders.CustID) INNER JOIN tblItem ON tblOrders.ItemCode = tblItem.ItemCode;
*** i make the order tables that satisfy the following needs
1. Who make the orders?
2. What are the Orders (Ordered Products)?
3. How many & how much?
4. Order date?
I make this as my subform in my main form name OrdersEntry
i name the subfrom qryOrders subform with a Record Source :
SELECT qryOrders.CustID, qryOrders.CustomerName, qryOrders.ItemCode,
qryOrders.ItemDescription, qryOrders.Quantity, qryOrders.Price,
qryOrders.Taxrate, qryOrders.Amount, qryOrders.TaxableAmt, qyrOrders.Total,
FROM qryOrders;
i set the Data Entry, Allow Additions and Allow Edits to Yes of my subform
so that as customer takes orders i will just type the customer ID access
will populate the customer name so also when i type the Products ID or ItemID
it will just populate the Item Description and Price to its corresponding
column.
1. Now what I need is to populate the CustId when i enter CustID in the
subfrom. I dont have any controls reside in my main form i go directly to my
subform to do the data entry.
2. I have a button cmdNewOrder with the code
On Error GoTo Err_NewOrder_Click
DoCmd.GoToRecord , , , acNewRec
Exit_NewOrder_Click:
Exit Sub
Err_NewOrder_Click:
MsgBox Err.Description
Resume Exit_NewOrder_Click
i need that as i click from this button it will generate me a new Invoice
number
like if the previous orders end with 723 then when i click on that button
it gives me 724 and populate to all the items of the next orders
i have already created 2 tables for Invoice and InvoiceDetail but i dont
know how to make that happens..
thank you again for your patience and time i really appreciate