We help IT Professionals succeed at work.

Create an updatable unmatched query

perennial
perennial asked
on
I created an unmatch query using the wizard from two tables. Now it will not let me edit the information. Are there other ways to run this query so that I can edit the record?

The following is my query:

SELECT tblMoveTemp.ItemNo, tblMoveTemp.Size, tblMoveTemp.Source, tblMoveTemp.Loc, tblMoveTemp.SowDat, tblMoveTemp.Index, tblMoveTemp.Consolidate, tblMoveTemp.CutBack, tblMoveTemp.TransDat
FROM tblMoveTemp LEFT JOIN tblTemp ON tblMoveTemp.ItemNo = tblTemp.IMITEM
WHERE (((tblTemp.IMITEM) Is Null));

??

perennial
Comment
Watch Question

Hi perennial,
If ItemNo is the primary key in both tables then you should be able to edit all fields except itemno.
I don't think you can ever change the primary key field in a query dynaset.

Pete
Leigh PurvisDatabase Developer
Commented:
That's true.
There's no obvious reason why that shouldn't be updateable.
Do both tables have a Primary key?

I suppose you could try the following - but if the above doesn't work - this might not either

SELECT tblMoveTemp.ItemNo, tblMoveTemp.Size, tblMoveTemp.Source, tblMoveTemp.Loc, tblMoveTemp.SowDat, tblMoveTemp.Index, tblMoveTemp.Consolidate, tblMoveTemp.CutBack, tblMoveTemp.TransDat
FROM tblMoveTemp
WHERE tblMoveTemp.ItemNo Not In (SELECT tblTemp.IMITEM  FROM tblTemp)
I too cannot see why it would not be updateable. I never seen a query created with the unmatched query wizard not be updatable. Did you try creating it again?

Right click in the top half of the query design view outside of the tables. Select properties. If recordset type is snapshot, change it to dynaset.

You will not be able to update tblMoveTemp.ItemNo unless cascade updates are on and it is not an autonumber field.

If you are using user level security, do you have permission to update the table and query?

Can you update the tables?

Type "When can I update data from a query?" in MSAccess help answer wizard for more information on when queries (datasets) are updatable or check this link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;304474#XSLTH4225121123120121120120

Author

Commented:
ItemNo in this case it is not PK and both table does not have primary key.

??
Leigh PurvisDatabase Developer

Commented:
Give both tables a primary key.

Author

Commented:
In this case I can not set the primary in both table, however your sql eariler is working. Let me get it another try and I will let you know.

Thanks for the help.

perennial