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
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