Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

data grid help needed - can compensate for code

I have a visual basic problem I cannot solve. I need help or to hire your firm 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. I can send a zipfile of the current source. I also have the ocx files

if you need them as well, 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. Its 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

=======================================================
Sign In or Register to comment.