I'll get this thing working if it kills me.

I have a datagrid whose datasource is a SQL query.
The infromation is displayed in the grid OK. When i click
on a cell to edit it i can change the value but when i click
on another cell i get the following message:-


'insufficient base table information for updating
or refreshing'

When i have the datasource as a single table i can
edit and update cells fine.

Can anyone point me in the right direction


Below is the code i use
___________________________________________________

Public Sub PopulateGrid()

Dim Cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
'frmMain.MyContractID = 1

dgdRateEntry.Visible = True


Set Cmd.ActiveConnection = frmMain.conn
Cmd.CommandType = adCmdText


Cmd.CommandText = "SELECT cl.event , cl.eventdescription, lp.Rate, " _
& "lp.rate as oldrate,'U' as flag" _
& " From linepayment lp,contractline cl" _
& " Where lp.contractlineid = cl.contractlineid" _
& " AND lp.contractid =" & frmMain.MyContractID & " Union" _
& " SELECT cl.event , cl.eventdescription, 0, " _
& " 0 as oldrate, 'I' as flag" _
& " From contractline cl " _
& " Where Not Exists" _
& " (Select * from linepayment lp " _
& " Where lp.contractlineid = cl.contractlineid " _
& " and lp.contractid=" & frmMain.MyContractID & ")"



rs.CursorType = adOpenDynamic
rs.CursorLocation = adUseClient
rs.Open Cmd, , adOpenDynamic, adLockOptimistic
Set dgdRateEntry.DataSource = rs
dgdRateEntry.ReBind


End Sub


_________________________________________________

Cheers