Populate Sub-Form also used for input

D

Duck

I have a main customer form with a sub-form which is used to input
items which are being sold to the customer. A sales order number is
generated via a button on the main form and then copied to a field on
the sub-form into which the sales items are entered.

I also have a combo box pull down list of all that particular
customers sales order numbers on the main form.

I would like to be able to use the sub-form for both input of new
sales and also to display the items that constitute old sales. would
like to be able to select a particular old sales order from the combo
box and have the sub-form populated with the items from the sale
represented by the sales order number selected.
 
J

John W. Vinson

I have a main customer form with a sub-form which is used to input
items which are being sold to the customer. A sales order number is
generated via a button on the main form and then copied to a field on
the sub-form into which the sales items are entered.

I also have a combo box pull down list of all that particular
customers sales order numbers on the main form.

I would like to be able to use the sub-form for both input of new
sales and also to display the items that constitute old sales. would
like to be able to select a particular old sales order from the combo
box and have the sub-form populated with the items from the sale
represented by the sales order number selected.

How do you "copy" the sales order number? I'd be much more inclined to use the
sales order number as the Master/Child Link Field for the subform; this will
not only enter the main form's sales order number in new subform records, but
also display all the existing records for that number.

John W. Vinson [MVP]
 
D

Duck

How do you "copy" the sales order number? I'd be much more inclined to use the
sales order number as the Master/Child Link Field for the subform; this will
not only enter the main form's sales order number in new subform records, but
also display all the existing records for that number.

John W. Vinson [MVP]

You asked how I copy the sales order number. I have a button control
on the main form that generates a sales order number from a
combination of the date and the customer ID in the form "070708-3218"
for customer number 3218 and today (yymmdd). The code behind the
click event of the button also populates the sales order number
control on the blank sub-form.
Are you saying that if I use the sales order number control (txtSONo)
as the Master/Child Link, instead of the Customer ID field, as I
presently am using, that this will accomplish both tasks for the
subform?
 
D

Duck

How do you "copy" the sales order number? I'd be much more inclined to use the
sales order number as the Master/Child Link Field for the subform; this will
not only enter the main form's sales order number in new subform records, but
also display all the existing records for that number.

John W. Vinson [MVP]

How do I change the Master/Child Link Field to the Sales Order Number
control?
 
J

John W. Vinson

Are you saying that if I use the sales order number control (txtSONo)
as the Master/Child Link, instead of the Customer ID field, as I
presently am using, that this will accomplish both tasks for the
subform?

Yes. Simply type txtSONo into the Master Link Field property of the subform.
It won't be on the list Access offers, but it will work.

John W. Vinson [MVP]
 

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