can not change a record because a related record is required

  • Thread starter Thread starter papa jonah
  • Start date Start date
P

papa jonah

My invoice subform which I used to enter line items appears to work
well except that when I finish adding one item and either try to move
on or enter another item I get the following message:
You can not add or change a record because a related record is required
in table 'tblProducts'.

I don't understand this. The entry was selected from a combobox that
was populated from tblProducts. So then why would it act as though the
product was not there? Am I misunderstanding?

TIA
 
Are you using a combo box for the product selection? If yes, there is a
very good chance you are trying to store the product description, as
shown in the combo, whereas the invoice item table has a product ID
field, and expects the product ID, not its description.
To check: look at your relationships, there should be one between the
line items table and the products table, on the product ID field; next,
look at the setup of the combo; to work correctly under the
circumstances, it rowsource should be a query on the products table,
returning the product ID and the product description fields (in this
order), with its column count property set to 2, its bound column
property set to 1, and, optionally, its column widths proprty set to 0;1
- or 0;whatever (zero so the first column, the ID one, is not visible).

HTH,
Nikos
 

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

Back
Top