can not change a record because a related record is required

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
 
N

Nikos Yannacopoulos

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
 
Top