RE: transfer data from main form to subform



Hi, Gazza.

The reason you can only add one record in the subform is that the subform is
currently linked on Part No, which is a field in the RecordSource of the
subform, and an unbound control on the main form. Whatever part number has
been entered in the footer is the only one that will show up in the subform.

This is a very unusual way to use a subform. Normally, a subform is linked
on a field common to the respective record sources of the main and the
subform. Before advising you of a way to allow multiple part numbers,
though, I'll need to understand your application better.

You mentioned in a previous that entering the CustomerID, presumably on the
previous form, sets the discount applicable to that customer. But there is
no Discount field in your Customer Details table. There is, however, a
Discount Code field in the Product Details table that leads me to believe
that the discount is product-specific. Both of these are hard to understand,
because in my experience, discount is related to an order quantity.

So please explain in detail how discounts are to be applied. For example,
are they related to a specific product, a specific order quantity, a specific
customer? Or a combination thereof?

Once I understand your intent, I'll be able to recommend a solution.

Sprinks

"Gazza" wrote:

> the forms recordsource is the query of the two tables.
>
> "Sprinks" wrote:
>
> > Gazza,
> >
> > Hmm. Are you saying the main form's RecordSource property is a query of the
> > product details table and customer tables? If this is so, and you're linking
> > on the ProductID field, you'll never be able to enter more than one detail
> > record. But I don't understand what the form is meant to do--is it an order
> > entry for a customer? I understand the details that you've given about your
> > forms, but please describe what the form's generic purpose is.
> >
> > Sprinks
> >
> > "Gazza" wrote:
> >
> > > Ok thanks sprinks here goes.
> > >
> > > The main forms recordsource is the product details table and customer
> > > details table.
> > >
> > > The subforms recordsourse is the product details table.
> > >
> > > My main form(PC1) opens up with the customer details entered and sts focus
> > > on the part no text box(PN1).I enter a part no(primary key) into the text box
> > > and it displays the info of the record(part no, description, price etc) from
> > > a table(Product Details) and then sets focus on the quantity text box(Q1) on
> > > the main form.
> > > when i enter a quantity it re-sets the focus back to the part no text box on
> > > the main form but it clears the line from the subform.
> > >
> > > The subform is set to a continuous form and i have tried setting the
> > > dataentry properties of both main form to yes and no amd subform to yes and
> > > no.
> > >
> > > Hope thats enough info to help.
> > >
> > > thanks
> > >
> > >
> > >
> > > "Sprinks" wrote:
> > >
> > > > Hi, Gazza.
> > > >
> > > > You don't give enough general information about what your main form is, but
> > > > normally a subform is for detail records about or related to a main form
> > > > record. The linking field, shown once in the main form will automatically be
> > > > entered in the linking field in the subform. So the answer to your question
> > > > is No.
> > > >
> > > > If you are creating an order, for example, that might have multiple part
> > > > numbers ordered, link by the OrderNumber instead. Otherwise, post more
> > > > generic information about your application and we'll try to help.
> > > >
> > > > Sprinks
> > >
.



Relevant Pages

  • RE: transfer data from main form to subform
    ... My approach would be create a continuous subform with a dummy table, ... consisting of Part No and Quantity fields as its RecordSource. ... > table).But some customers will have a different discount for a product ... sets the discount applicable to that customer. ...
    (microsoft.public.access.forms)
  • Re: setting RecordSource vs. setting RecordSource and Filter
    ... the subforms to display nothing since the link master ... My top-level form has a subform, and a sub-subform, etc. Could I leave my ... subforms bound and then just hook up the RecordSource of my top-level form ... it loads the form without any filter, ...
    (microsoft.public.access.modulesdaovba)
  • RE: transfer data from main form to subform
    ... Are you saying the main form's RecordSource property is a query of the ... product details table and customer tables? ... > The main forms recordsource is the product details table and customer ... > the main form but it clears the line from the subform. ...
    (microsoft.public.access.forms)
  • Re: Unbound forms recordsource property changes
    ... Dim prm As ADODB.Parameter ... The form has several tabs and as a tab is selected I use the on change event ... to call the appropriate sub to populate the subform on the tab with data ... I then set the recordsource of the form via vba to the ...
    (comp.databases.ms-access)
  • Re: Access 2003 Forms and Subforms with Parameter Query
    ... If RecordSource = "" Then ... <MS ACCESS MVP> ... subform to open the parameter query (or to pass along the recordset ... the "onclick" event for the button to run the query ...
    (microsoft.public.access.formscoding)