Change Order for a Report

B

Bob

Can I change the report order by HorseName1 Asending [Not by HorseID] or by
dtdate as this is doing
Thanks for any Help...Bob

Private Sub Report_Open(Cancel As Integer)
Category.ControlSource = "='" & Form_frmMain.cbCategory & "'"
tblHorseInfo,qryCategory where tblRemarks.HorseID=tblHorseInfo.HorseID and
qryCategory.HorseID = tblHorseInfo.HorseID and qryCategory.dtdate1 =
tblRemarks.dtDate ORDER BY tblRemarks.dtDate DESC;
Me.RecordSource = "SELECT tblRemarks.dtDate, funGetHorse(0,
qryCategory.HorseID,false) AS HorseName1, " _
& " tblRemarks.Category, tblRemarks.Remark FROM tblRemarks, qryCategory
WHERE qryCategory.HorseID " _
& " = tblRemarks.HorseID And qryCategory.RemarkID1 = tblRemarks.RemarkID
" _
& " and tblRemarks.Category='" & Form_frmMain.cbCategory & "'" _
& " ORDER BY tblRemarks.dtDate DESC; "
Debug.Print Me.RecordSource
End Sub
 
D

Damian S

Hi Bob,

Either change the sorting and grouping in the report itself, or change your
ORDER BY clause to use HoreName1 rather than dtDate.

Hope this helps.

Damian.
 
M

Maurice

Hi Damian,

Unlucky typo there... gives the report a whole different look ;-)

Maurice

Damian S said:
Hi Bob,

Either change the sorting and grouping in the report itself, or change your
ORDER BY clause to use HoreName1 rather than dtDate.

Hope this helps.

Damian.

Bob said:
Can I change the report order by HorseName1 Asending [Not by HorseID] or by
dtdate as this is doing
Thanks for any Help...Bob

Private Sub Report_Open(Cancel As Integer)
Category.ControlSource = "='" & Form_frmMain.cbCategory & "'"
tblHorseInfo,qryCategory where tblRemarks.HorseID=tblHorseInfo.HorseID and
qryCategory.HorseID = tblHorseInfo.HorseID and qryCategory.dtdate1 =
tblRemarks.dtDate ORDER BY tblRemarks.dtDate DESC;
Me.RecordSource = "SELECT tblRemarks.dtDate, funGetHorse(0,
qryCategory.HorseID,false) AS HorseName1, " _
& " tblRemarks.Category, tblRemarks.Remark FROM tblRemarks, qryCategory
WHERE qryCategory.HorseID " _
& " = tblRemarks.HorseID And qryCategory.RemarkID1 = tblRemarks.RemarkID
" _
& " and tblRemarks.Category='" & Form_frmMain.cbCategory & "'" _
& " ORDER BY tblRemarks.dtDate DESC; "
Debug.Print Me.RecordSource
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top