Access Forms

A

aburrows

I have a subform linked to a form. The subform selects a number o
records and shows this as a datasheet. I want to be able to select
row from the datasheet and transfer this information onto a new form
Any ideas
 
M

MacDermott

Could you be a little more specific about "transfer this information onto a
new form"?
What information do you want to "transfer"?
Are you creating this "new form" from scratch each time?
Is the new form bound to a table?
 
A

aburrows

Thanks for your interest. The main form is requesting invoice number an
the subform shows items on the invoice displayed as a datasheet.
The scenario is that the user will need to add further data relevant t
one or two items on the datasheet. My thoughts are that I would selec
one or two items from the datasheet and transfer the relevant quantity
price, detail etc to a form that would be created from the infomation o
the datasheet to allow the user to add additional information relevan
to these items. Hope this explains things a little more
 
M

MacDermott

OK, so the second form is not so much "new" as simply another form, a
different way of presenting the same information.
And the data is not being transferred (copied), but simply the same data
displayed in a different way.
This may sound like quibbling, but these are the kinds of issues which make
questions easy/difficult to understand and respond to.

Let's take a look at the table structure behind all this.
Do you have a single table for all information on invoice items?
Or do you have one table which shows the items on your datasheet, and
another for the "further relevant data"?
 
A

aburrows

You are entirely correct, this is just another form presenting the sam
data in a different way.

I have two tables, one for invoice item information and the other fo
'further information' these are linked by invoice number.

Thank
 
M

MacDermott

That suggests that the "further information" is specific only to the
invoice; it's not linked with a particular item on the invoice.
That, in turn, is a bit different from the scenario you were
constructing, where you selected one or more items in the invoice because
those were the ones you wanted to add more data to.
If the "further information" is linked to a specific invoice item, there
will need to be some way to indicate which item it's linked to...
 
A

aburrows

Apologies for the delay in replying I have been away since Thursday
Sorry for the confusion, the 'further information' is linked to
specific item on the invoice. The tables are linked by Invoice Numbe
and FP Number, which in reality is the item number as an invoice woul
not contain duplicate FP numbers....Thank
 
M

MacDermott

For safety's sake, I'd suggest a unique composite index, just to make sure
that the InvoiceNumber - FPNumber combination is unique.
This can be the primary key of your InvoiceDetails table.
It should be the primary key of your FurtherInformation table.
You can then define a one-to-one relationship between the two tables, with a
cascade update from InvoiceDetails to FurtherInformation. (This will not by
iteself require a record in FurtherInformation for each record in
InvoiceDetails.)

Now you can create a query linking both tables, with a join which says "show
all records for InvoiceDetail and only related records for
FurtherInformation." Base your "new" form on this query; I'll call it
frmFurther, but you can name it as you like.

In whatever event procedure you want to use to show this new form, use code
like this:
DoCmd.OpenForm "frmFurther",,,"[Invoice Number] = " & [Invoice Number] &
" AND [FP Number]=" & [FP Number]

I think that will do it. If you're launching the new form from the main
form, you'll need to qualify the control references.
 
Top