Subform link problem

A

Alan T

I have a main form which display the details of an invoice from a query:
SELECT *
FROM Invoices
WHERE InvoiceNumber = [InvoiceNum]

I have a button to execute this query and pass the parameter, eg. 100 as
InvoiceNum parameter value.

I also have a subform in datasheet format, displays the invoice items and
also allows the user to enter the invoice items.

The link has been setup
Source Object: frmInvoiceItems
Link Child Fields: InvoiceNumber
Link Master Fields: InvoiceNumber
This subform link to the record source of a query:
SELECT *
FROM InvoiceItems

Table InvoiceItems:
InvoiceNumber
ItemNo
Desc
Price
Qty

The problem I have is although the user can enter invoice items, the
InvoiceNumber is empty in the InvoiceItem table.
So that means there is no link between the main form and the subform.
 
C

Carl Rapson

Alan T said:
I have a main form which display the details of an invoice from a query:
SELECT *
FROM Invoices
WHERE InvoiceNumber = [InvoiceNum]

I have a button to execute this query and pass the parameter, eg. 100 as
InvoiceNum parameter value.

I also have a subform in datasheet format, displays the invoice items and
also allows the user to enter the invoice items.

The link has been setup
Source Object: frmInvoiceItems
Link Child Fields: InvoiceNumber
Link Master Fields: InvoiceNumber
This subform link to the record source of a query:
SELECT *
FROM InvoiceItems

Table InvoiceItems:
InvoiceNumber
ItemNo
Desc
Price
Qty

The problem I have is although the user can enter invoice items, the
InvoiceNumber is empty in the InvoiceItem table.
So that means there is no link between the main form and the subform.

On the surface everything looks OK, so I have to ask the obvious questions.
Are both fields are named InvoiceNumber? Are both fields of the same data
type? Have you tried setting a link between the two tables in the
Relationships window? Have you tried your subform in Continuous view instead
of Datasheet view?

Carl Rapson
 

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