DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   MSHFlex Grid Field get Highlighted if it is current date (http://www.daniweb.com/forums/thread166530.html)

Ravi Kant Jan 6th, 2009 9:14 am
MSHFlex Grid Field get Highlighted if it is current date
 
I am doing a project in VB and have used ADODC connection to connect in Access Database. I have used MSHFlexGrid and want it's data get highlighted Automatically if it is on current date (i.e Today's Date) for Birthday Reminder. How can i do it?

QVeen72 Jan 7th, 2009 11:54 pm
Re: MSHFlex Grid Field get Highlighted if it is current date
 
Hi,

Once the Grid is Loaded, Loop thru the column and Highlight if matching, Say, you are Date Column is 2, Check this Code:

Dim i As Integer
For i = 1 To Grd.Rows-1
If ISDate(Grd.TextMatrix(i,2)) Then
  If CDate(Grd.TextMatrix(i,2)) = Date Then
      Grd.Col = 2
      Grd.Row = i
      Grd.CellFontBold = True
    Grd.CellBackColor = vbBlue
    Grd.CellFontColor = vbWhite
  End If
Next

Change Control Name accordingly..

Regards
Veena


All times are GMT -4. The time now is 10:38 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC