How to make a pass through query UPDATEABLE? (1 Viewer)

papic1972

Registered User.
Local time
Tomorrow, 01:19
Joined
Apr 14, 2004
Messages
122
Hi all,

I have the following pass through query on a listbox:

SELECT tblLocal.LoadLineID, tblLocal.Suburb, tblContract.Contract, tblLocal.Yard, tblLocal.BrickType, tblLocal.Qty, tblLocal.JDNo, tblLocal.DeliveryDate, tblLocal.Plant, tblLocal.SpecialReq, tblLocal.TruckType, tblLocal.AreaKlm, tblLocal.Pallets, tblContract.ContractID, tblLocal.LoadBoxNo, tblLocal.Driver, tblLocal.Allocated, tblContract.Abbrev, Case when tblContract.[Abbrev] Is Null Then [Plant] Else tblContract.[Abbrev] end AS Abbrev2, tblLocal.DeliverySlot, tblLocal.OrderID, tblLocal.Builder, tblLocal.DriverNo
FROM tblLocal INNER JOIN
tblContract ON tblLocal.ContractID = tblContract.ContractID
WHERE (((tblLocal.JDNo)=1001) AND (tblLocal.Allocated)=0);

In its current state it is not updateable. Can anyone help me make this updateable?

Cheers.
 

namliam

The Mailman - AWF VIP
Local time
Today, 17:19
Joined
Aug 11, 2003
Messages
11,695
Why would you need a listbox updatable? A listbox cannot be updated??

For a pass through to be editable, you need:
1) The PK of all tables in your query
2) The right privileges on the target database

General comments:
1) Please use the code brackets when posting SQL putting [ code ] and [ /code ] around the sql (or press the # button on top of the post)

2)
Case when ...
Most databases have functions like NZ, NVL, Isnull, Coalesce to do that much easier:
NZ(tblContract.[Abbrev], [Plant] )

3) Query format
Do not just splash queries, not on forums but not in your code either, make them maintanable/readable:
Code:
Select field1
     , field2 
     , field3
From       Table1 
Inner Join Table2 ...
Left  Join Table3 ...
Where Field1 = 'abc'
  and Field2 = 123
 

Users who are viewing this thread

Top Bottom