Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Including picture in flexgrid

Status
Not open for further replies.

chrsab

Programmer
May 24, 2002
44
GB
Hello

There are a couple of threads about my issue but nothing that can help so far.

I have various textbox's which are populated with info from a database using a adodc control. My flexgrid populates with each row from my database, which is fine. But when i try to introduce a picture instead of text using an if statement i get alsorts of problems.

Below is the code which i am using:

Dim N As Integer

N = 0

Do

N = N + 1

search = FindLastLine(Text2.Text, CmbEmpSearch.List(N))
search2 = Mid(search, 57, 14)

Adodc1.Recordset.AddNew

FlexGrid1.Cols = CmbEmpSearch.ListCount

Label24.Caption = Left(search, 17)
If Label24.Caption = "System Bootup On:" Then
With FlexGrid1
.Text = ""
.Row = N
.Col = 1
Set .CellPicture = Image5.Picture
.CellAlignment = flexaligncentrecentre
End With
Else
With FlexGrid1
.Text = ""
.Row = N
.Col = 1
Set .CellPicture = Image6.Picture
.CellAlignment = flexaligncentrecentre
End With

End If

Label25.Caption = Mid(search, 29, 10)
Label26.Caption = Mid(search, 43, 8)
Label27.Caption = CmbEmpSearch.List(N)
Label28.Caption = Mid(search, 71, 10)

Loop Until N = CmbEmpSearch.ListCount + 1

Adodc1.Refresh

FlexGrid1.Refresh

I am sure the problem is with .Row = N but instead of this i don't know what to do to get each row using the same if statement.

Any help will be muchly appreciated.

Thank you very much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top