ass
  • ass
  • Newbie Topic Starter
2014-01-31T13:32:55Z
Hello, I am interested in ActiveX but I have a question that I could not solve, how do I change the color of the line when I do a filter through my SQL?

'---------------------------------------
'CODE - MS ACCESS 2010
'---------------------------------------

Privete Function MyFNC
Dim strsql
strsql = "select codigo, rzsocial from clientes where rzsocial like '%" & Me.txBusca.Text & "%'"

ConL (strsql)

If rsL.RecordCount = 0 Then Exit Function

Dim grd As iGrid
Set grd = grid.Object


grd.RowMode = True

'--Here we report the line filtered, but is only in gray, difficult viewing.

grd.CurRow = rsL(0)

End Function
Igor/10Tec
2014-01-31T13:50:42Z
Did you mean that you need to select the first row and highlight it accordingly?

If yes, then you need to use the following code:

grd.CurRow = 1

CurRow is the NUMERICAL index of the selected row.
ass
  • ass
  • Newbie Topic Starter
2014-01-31T15:40:33Z
It is almost this, I now how to highlight the row but I want to change the color of it, the patten is light gray.

How can I change it?

Thanks!
Igor/10Tec
2014-02-03T08:27:57Z
If you use the standard color scheme in Windows, the grey color means that the whole grid control is not in focus (inactive). In MS Access, you use the SetFocus method to move the input focus to the required control.

Look also at the HighlightForeColor/HighlightBackColor/HighlightForeColorNoFocus/HighlightBackColorNoFocus properties of iGrid. They are used to specify the color of selected cells.
ass
  • ass
  • Newbie Topic Starter
2014-02-03T12:44:17Z
Problem solved, thank you!