Hi Zemp,
i'm using an unbound grid. i'm trying to bind it with an ADO control but i'm not being able to do so. The message i'm getting is link to an intrinsic data control. What does that mean? My codes are as follows:
Private Sub MSFlexJob_EnterCell()
If MSFlexJob.MouseRow = 0 Or MSFlexJob.MouseCol = 0 Then
Txt_grid.Visible = False
Exit Sub
End If
Txt_grid.Text = ""
Txt_grid.Visible = False
Txt_grid.Top = MSFlexJob.Top + MSFlexJob.CellTop
Txt_grid.Left = MSFlexJob.Left + MSFlexJob.CellLeft
Txt_grid.Width = MSFlexJob.CellWidth
Txt_grid.Height = MSFlexJob.CellHeight
Txt_grid.Text = MSFlexJob.Text
Txt_grid.Visible = True
Txt_grid.SetFocus
End Sub
Private Sub MSFlexJob_LeaveCell()
MSFlexJob.Text = Txt_grid.Text
End Sub
Private Sub fillflexgrid(ByVal sql As String)
Dim rs As New ADODB.Recordset
Dim count As Integer
Dim MyIndex As Integer
count = 0
rs.Open sql, Cnn, adOpenForwardOnly, adLockReadOnly
Do Until rs.EOF
count = count + 1
MSFlexJob.AddItem vbTab & rs("ClientCode"

& vbTab & rs("JobCode"
rs.MoveNext
Loop
MaxRows = count
End Sub
Private Sub search_Click()
Dim strClient As String
Dim ds As New ADODB.Recordset
strClient = InputBox("Enter Client Code"

If strClient = vbNullString Then
Exit Sub
Else
ds.Open "select * from TClient where ClientCode = '" & pstrStatus & "'", Cnn
If ds.EOF = True Then
Call MsgBox("Cannot find record.", vbOKOnly)
Else
Me.ClientCode = ds!ClientCode
Me.ClientName = ds!ClientName
Me.ActivityOfClient = ds!Activity
Me.ContactName = ds!ContactName
Me.DateOfIncorporation = ds!DateOfIncorporation
Me.PartnerName = ds!PartnerName
Me.TDescription = ds!Description
Me.Telephone = ds!Telephone
Me.YearEnded = ds!YearEnded
ds.Close
Dim rs As New ADODB.Recordset
Dim sql
sql = "select * from TClientJob where ClientCode = '" & ClientCode & "' "
rs.Open "select * from TClientJob where ClientCode = '" & ClientCode & "'", Cnn
With MSFlexJob
.TextMatrix(0, 1) = "ClientCode"
.TextMatrix(0, 2) = "Job Code"
.TextMatrix(0, 3) = "Services"
.TextMatrix(0, 4) = "QuotedFees"
.TextMatrix(0, 5) = "Invoice"
End With
fillflexgrid (sql)
End If
End If
End Sub
Private Sub Save_Click()
Dim a
a = ClientCode.Text
CCode.Text = a
Cnn.Execute ("INSERT INTO TClient(ClientCode, ClientName, IncentiveStatus, Description, Activity, DateOfIncorporation, YearEnded, ContactName, PartnerCode, PartnerName, Telephone) VALUES ( '" _
& CCode & "' , '" & ClientName & "' , '" & TIncentiveStatus & "', '" & TDescription & "' , '" & ActivityOfClient & "', '" & DateOfIncorporation & "' , '" & YearEnded & "', '" & ContactName & "', '" & EPartnerCode & "', '" & PartnerName & "', '" & Telephone & "' )"

Cnn.Execute ("INSERT INTO TClientJob(ClientCode) VALUES ('" & ClientCode & "')"
I'm using the above code to insert data in the database but for the flexgrid i dont know how to do it.
Plz help.
Thanks