|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
type mismatch error; date sort
I have a fixed row heading (Last Feed) in my MSFlexGrid. The code is giving me a type mismatch error because of this row. How would I change this code to exclude the fixed row?
Dim i As Integer Dim j As Integer Dim Temp_Date_1 As Double Dim Temp_Date_2 As Double 'Setting Description '–1 If row1 should appear before row2. '0 If both rows are equal or either row can appear before the other. '1 If row1 should appear after row2. 'frmWatch.MSFlexGrid1.Col = 1 'frmWatch.MSFlexGrid1.Sort = 9 frmWatch.MSFlexGrid1.Row = Row1 Temp_Date_1 = CDbl(CVDate(frmWatch.MSFlexGrid1.Text)) 'Type mismatch error frmWatch.MSFlexGrid1.Row = Row2 Temp_Date_2 = CDbl(CVDate(frmWatch.MSFlexGrid1.Text)) If (Temp_Date_2 < Temp_Date_1) Then Cmp = 1 ElseIf Temp_Date_2 = Temp_Date_1 Then Cmp = 1 Else Cmp = -1 End If Thanks |
|
#2
|
|||
|
|||
|
you do not appear to have st Row1 or Row2 so first time in it will be 0 (your fixed row)
Another approach might be to Select your whole data area excluding row 0 and then use the MSflexgtids in-built sort on a column, that way you dont need to worry about temp variables etc |
|
#3
|
|||
|
|||
|
you do not appear to have st Row1 or Row2 so first time in it will be 0 (your fixed row)
Another approach might be to Select your whole data area excluding row 0 and then use the MSflexgtids in-built sort on a column, that way you dont need to worry about temp variables etc |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > type mismatch error; date sort |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|