Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 2nd, 2003, 08:32 AM
Purdue2379 Purdue2379 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 4 Purdue2379 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old December 10th, 2003, 04:31 AM
williamcrawley williamcrawley is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: uk
Posts: 91 williamcrawley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
  #3  
Old December 10th, 2003, 04:31 AM
williamcrawley williamcrawley is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: uk
Posts: 91 williamcrawley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > type mismatch error; date sort


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT