recordset problem

  • Thread starter Thread starter 00allen_iverson
  • Start date Start date
0

00allen_iverson

I tried to run a select query based on two tables and they are linked by two
fields. After I open up the datasheet as of the result of the query, I tried
to change the value in one of the field and it said "recordset is not
updatable". Can anyone please help? Thanks.
 
00allen_iverson said:
I tried to run a select query based on two tables and they are linked by
two fields. After I open up the datasheet as of the result of the query, I
tried to change the value in one of the field and it said "recordset is
not updatable". Can anyone please help? Thanks.

You need to have the appropriate indexes on the table. In a typical
scenario, you might have two tables:
tblOrder: OrdID, OrdNumber, OrdDate, etc
tblOrderItem: ItmID, ItmOrdID, ItmProduct, ItmQuantity, etc
So you can have many line items on one order. Both tables have primary keys
(OrdID and ItmID) and the field ItmOrdID is indexed with duplicates allowed.
As an extra (and advisable) step, you can enforce referential integrity
between the two fields.
When you create a query, you will find that the join is added automatically
and the query is updateable.
 
If the field you are trying to change is used in the link, then it will be
read only as changing the relationship would invalidate the row. If the
field is NOT part of the relationship (or PK/FK constraints) it will be
updatable.
 
Back
Top