Connecting Tech Pros Worldwide Help | Site Map

Sorting records using visual basic

John M
Guest
 
Posts: n/a
#1: Nov 13 '05
I can open a form using a combo box to select a group of records.

stLinkCriteria = "[Tu]= '" & Me![PrintTu] & "'"
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria

[PrintTu] is what comes from the combo box.

I would also like the records to be sorted in an order not the same as the
underlying table. I would imagine this should be simple, but to me, and
amateur, it's not!

Thanks in advance for any help.


Allen Browne
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Sorting records using visual basic


See:
Sorting Records in a Report at run-time
at:
http://allenbrowne.com/ser-33.html

The article explains how to programmatically set the ControlSource of the
GroupLevel in the report's Open event.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John M" <john@jmawer.demon.co.uk> wrote in message
news:d3qkr9$h7d$1$8302bc10@news.demon.co.uk...[color=blue]
>I can open a form using a combo box to select a group of records.
>
> stLinkCriteria = "[Tu]= '" & Me![PrintTu] & "'"
> DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
>
> [PrintTu] is what comes from the combo box.
>
> I would also like the records to be sorted in an order not the same as the
> underlying table. I would imagine this should be simple, but to me, and
> amateur, it's not!
>
> Thanks in advance for any help.[/color]


Closed Thread