I have a visual basic problem I cannot solve. I need to hire someone to do this work / code
project. Need the below to work with the date and text fields so that it will do the VB 6 sort
routine without a problem. Basically need two or three snippets to do the function. Can you write
this type of code. file is too bit to attach zipfile of the current source. I also have the ocx files
if you need them as well and can email them, I can send you those separately as they are an install from the last
person who had this job.
Data grid is the one on the form: outpatient.frm on the outpatient log tab. I need a sort routine
for the date field and for a text field using two command button on the same form. I cannot get
it to sort by anything other than the recid (family id).
I have references if you want to make sure I write and send payment correcty. Please take a look
at this as soon as you can. questions? 203 394 6529 please leave your number if you get
voicemail. It’s a snippet or two and the lady downstairs needs this as soon as possible so we can
get the data collected. Chris Monroe
================================================== =====
The below works good for sorting by the autonumber field (FAMILYID) but its not good for sorting
by date, need to have this copied 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 on that sql view on the date
but that does not work. How can i change recid to something else so it will function.
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
================================================== =====