populate to all rows in the subform

  • Thread starter Thread starter Revned
  • Start date Start date
R

Revned

hi all,

i have a subform under main form
this subform has a SQL record source
i set Data Entry, Allow Edits, Allow Additions to Yes
is there a way to populate data i have enter under CustID field to all
its field let say i have this field in my subform

CustID Item Quantity Price Amount
1 17-MN 4 10.00 40.00
1

i want that as user press the key tab it goes to the second rows and
populate the
CustID, i am using access 2003

thanks for any help i really appreciate
 
hi all,

i have a subform under main form
this subform has a SQL record source
i set Data Entry, Allow Edits, Allow Additions to Yes
is there a way to populate data i have enter under CustID field to all
its field let say i have this field in my subform

CustID Item Quantity Price Amount
1 17-MN 4 10.00 40.00
1

i want that as user press the key tab it goes to the second rows and
populate the
CustID, i am using access 2003

thanks for any help i really appreciate

If the CustID is a field on the main form, make it the Master Link Field and
Child Link Field of the subform control.

If not, please explain your data structure. What's the recordsource of the
mainform and the subform? How should Access determine WHICH CustID needs to be
filled in?
 
they are the same record source what i did is that every time
an cutomer takes his new order i will just entry his id
because i don' know how to control from main form to subform

where can i find that master link field and child link field

thank you very much for your time
 
they are the same record source

You mean you only have one table? Surely one Customer can have multiple
Orders; if so you need *two different tables*. A Customer is not an Order, and
an Order is not a Customer.
what i did is that every time
an cutomer takes his new order i will just entry his id
because i don' know how to control from main form to subform

where can i find that master link field and child link field

On the Properties sheet for the Subform control (the box on the mainform which
contains the subform).
thank you very much for your time

You may want to take a look at Crystal's video or some of the other resources:

Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html

The Access Web resources page:
http://www.mvps.org/access/resources/index.html

Roger Carlson's tutorials, samples and tips:
http://www.rogersaccesslibrary.com/

A free tutorial written by Crystal:
http://allenbrowne.com/casu-22.html

A video how-to series by Crystal:
http://www.YouTube.com/user/LearnAccessByCrystal

MVP Allen Browne's tutorials:
http://allenbrowne.com/links.html#Tutorials
 
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
 
Back
Top