codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  interesting issue - need help sorting by date - data grid  chrismonroe10 at 16:07 on Tuesday, February 01, 2005
 

This works good for sorting by the autonumber field (FAMILYID) but its not good for sorting by date, can someone please tell me how can i change this to sort by the date field which is REF_DT. I substituted REF_DT for FAMILYID below and it just errors out with the error - improper use of variable. The view for adopatients is VWOUTPATIENT and i've tried to use ascending there on the date but that does not work. How can i change recid to something else so it will function any ideas would be very much appreciated.


Private Sub Command1_Click()
' ***** simple sort button *********
Call SortRtn(0, Me.grdOutP.Columns(Me.grdOutP.Col).DataField, Me.grdOutP.Col, "ADOPATIENTS")
' **** end *****
End Sub


Public Sub SortRtn(intSortMode As Integer, strColname As String, intCol As Integer, strAdo As String)
' *************** sort by the autonumber field ************
'A Public Sort Routine
'intSortMode determine sort method 0 for ascending 1 for descending
'strColName determines the column in the grid to sort by
'intCol is the column number
'strAdo determines which grid to sort
Dim recid As Long 'What record are we currently on
Select Case strAdo
Case "ADOPATIENTS"
recid = FRMOUTPATIENT.adoOutP.Recordset.Fields("FAMILYID")
If intSortMode = 0 Then
FRMOUTPATIENT.adoOutP.Recordset.Sort = strColname
Else
FRMOUTPATIENT.adoOutP.Recordset.Sort = strColname & " DESC"
End If
FRMOUTPATIENT.adoOutP.Recordset.Find "FAMILYID = " & recid
End Select
' **** end *****
End Sub









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Job @ EarlySail
•  Job @ EarlySail (perl)
•  Security - Code verify
•  IPC problem
•  Re: import contacts of msn/yahoo
•  Cookies and Threads C++
•  right justify a background in a table?
•  Help with Loop (C++/MFC)
•  Help with Loop (C++/MFC)


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007