A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Select Sort Order Through a Form



 
 
Thread Tools Display Modes
  #1  
Old January 23rd, 2006, 11:02 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Select Sort Order Through a Form

In an MDE database where users don't have rights to edit the report design,
I would like the user to be able to select the sort order of a report in a
combo box on a form.
How would I tell the report that the sort order is, for example, equal to
[forms]![reportselector]![sortorder] ?

Thanks in advance,
Kathy


  #2  
Old January 24th, 2006, 03:10 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Select Sort Order Through a Form

You might want to check the tip on Allen Browne's site
http://allenbrowne.com/ser-33.html.

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
In an MDE database where users don't have rights to edit the report
design, I would like the user to be able to select the sort order of a
report in a combo box on a form.
How would I tell the report that the sort order is, for example, equal to
[forms]![reportselector]![sortorder] ?

Thanks in advance,
Kathy



  #3  
Old January 24th, 2006, 08:19 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Select Sort Order Through a Form

I'm sorry but that doesn't help me. Perhaps it is too advanced for me. :-(
Can you, or anyone else, be more specific?
Thank you

"Duane Hookom" wrote in message
...
You might want to check the tip on Allen Browne's site
http://allenbrowne.com/ser-33.html.

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
In an MDE database where users don't have rights to edit the report
design, I would like the user to be able to select the sort order of a
report in a combo box on a form.
How would I tell the report that the sort order is, for example, equal to
[forms]![reportselector]![sortorder] ?

Thanks in advance,
Kathy





  #4  
Old January 24th, 2006, 10:42 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Select Sort Order Through a Form

What are the values in your combo box and what field do these values
correspond with?

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
I'm sorry but that doesn't help me. Perhaps it is too advanced for me. :-(
Can you, or anyone else, be more specific?
Thank you

"Duane Hookom" wrote in message
...
You might want to check the tip on Allen Browne's site
http://allenbrowne.com/ser-33.html.

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
In an MDE database where users don't have rights to edit the report
design, I would like the user to be able to select the sort order of a
report in a combo box on a form.
How would I tell the report that the sort order is, for example, equal
to [forms]![reportselector]![sortorder] ?

Thanks in advance,
Kathy







  #5  
Old January 24th, 2006, 11:30 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Select Sort Order Through a Form

Duane: I can't get Allen's method, neither.

Here is my design:

Assuming Radio butoon on form "Choose Sort" in option group "grpSort" with
values and captions:
1. ID (primary key) also default value for grpSort
2. Fst Name
3. Lst Name
Also one command button "pvwrpt" to open report "Myreport" in preview view.

Then, the question is: where should I add this following codes???
Select Case Forms!ChooseSort!grpSort
Case 1' ID
Me.GroupLevel(0).ControlSource ="ID"
Me.GroupLevel(1).ControlSource ="Fst Name"
Me.GroupLevel(2).ControlSource ="Lst Name"
Case 2 'Fst Name
Me.GroupLevel(0).ControlSource ="Fst Name"
Me.GroupLevel(1).ControlSource ="ID"
Me.GroupLevel(2).ControlSource ="Lst Name"
Case 3 'LstName
Me.GroupLevel(0).ControlSource ="LstName"
Me.GroupLevel(1).ControlSource ="ID"
Me.GroupLevel(2).ControlSource ="Fst Name"
End Select

Also if I want dynamic sorting, Allen suggests me to use the following code
when Report "MyReport" is open:
Dim strDoc As String
strDoc="Myreport"
If IsLoaded(strDoc) Then
DoCmd.Close aReport, strDoc
DoCmd.OpenReport strDoc, acViewPreview
End If
How come IsLoaded is not predefined at the VB???

Thank you for giving me more instructions.....






Follow to Allen's instructions, th code




"Duane Hookom" wrote:

What are the values in your combo box and what field do these values
correspond with?

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
I'm sorry but that doesn't help me. Perhaps it is too advanced for me. :-(
Can you, or anyone else, be more specific?
Thank you

"Duane Hookom" wrote in message
...
You might want to check the tip on Allen Browne's site
http://allenbrowne.com/ser-33.html.

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
In an MDE database where users don't have rights to edit the report
design, I would like the user to be able to select the sort order of a
report in a combo box on a form.
How would I tell the report that the sort order is, for example, equal
to [forms]![reportselector]![sortorder] ?

Thanks in advance,
Kathy








  #6  
Old January 25th, 2006, 12:38 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Select Sort Order Through a Form

As the web page states "with code like this in the Open event of the
report:"

Another issue you might have is your use of spaces in field names. Try wrap
your field names in [ ]s
Me.GroupLevel(1).ControlSource ="[Fst Name]"

--
Duane Hookom
MS Access MVP
--

"Vivi" wrote in message
...
Duane: I can't get Allen's method, neither.

Here is my design:

Assuming Radio butoon on form "Choose Sort" in option group "grpSort" with
values and captions:
1. ID (primary key) also default value for grpSort
2. Fst Name
3. Lst Name
Also one command button "pvwrpt" to open report "Myreport" in preview
view.

Then, the question is: where should I add this following codes???
Select Case Forms!ChooseSort!grpSort
Case 1' ID
Me.GroupLevel(0).ControlSource ="ID"
Me.GroupLevel(1).ControlSource ="Fst Name"
Me.GroupLevel(2).ControlSource ="Lst Name"
Case 2 'Fst Name
Me.GroupLevel(0).ControlSource ="Fst Name"
Me.GroupLevel(1).ControlSource ="ID"
Me.GroupLevel(2).ControlSource ="Lst Name"
Case 3 'LstName
Me.GroupLevel(0).ControlSource ="LstName"
Me.GroupLevel(1).ControlSource ="ID"
Me.GroupLevel(2).ControlSource ="Fst Name"
End Select

Also if I want dynamic sorting, Allen suggests me to use the following
code
when Report "MyReport" is open:
Dim strDoc As String
strDoc="Myreport"
If IsLoaded(strDoc) Then
DoCmd.Close aReport, strDoc
DoCmd.OpenReport strDoc, acViewPreview
End If
How come IsLoaded is not predefined at the VB???

Thank you for giving me more instructions.....






Follow to Allen's instructions, th code




"Duane Hookom" wrote:

What are the values in your combo box and what field do these values
correspond with?

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
I'm sorry but that doesn't help me. Perhaps it is too advanced for me.
:-(
Can you, or anyone else, be more specific?
Thank you

"Duane Hookom" wrote in message
...
You might want to check the tip on Allen Browne's site
http://allenbrowne.com/ser-33.html.

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
In an MDE database where users don't have rights to edit the report
design, I would like the user to be able to select the sort order of
a
report in a combo box on a form.
How would I tell the report that the sort order is, for example,
equal
to [forms]![reportselector]![sortorder] ?

Thanks in advance,
Kathy










  #7  
Old January 26th, 2006, 01:22 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Select Sort Order Through a Form

Hi Duane,

1 = sort by FileName
2 = sort by FileNumber
3 = sort by DateOpened

Thanks again,
Kathy

"Duane Hookom" wrote in message
...
What are the values in your combo box and what field do these values
correspond with?

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
I'm sorry but that doesn't help me. Perhaps it is too advanced for me.
:-(
Can you, or anyone else, be more specific?
Thank you

"Duane Hookom" wrote in message
...
You might want to check the tip on Allen Browne's site
http://allenbrowne.com/ser-33.html.

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
In an MDE database where users don't have rights to edit the report
design, I would like the user to be able to select the sort order of a
report in a combo box on a form.
How would I tell the report that the sort order is, for example, equal
to [forms]![reportselector]![sortorder] ?

Thanks in advance,
Kathy









  #8  
Old January 26th, 2006, 05:58 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Select Sort Order Through a Form

Select Case [forms]![reportselector]![sortorder]
Case 1' ID
Me.GroupLevel(0).ControlSource ="FileName"
Me.GroupLevel(1).ControlSource ="FileNumber"
Me.GroupLevel(2).ControlSource ="DateOpened"
Case 2 'Fst Name
Me.GroupLevel(0).ControlSource ="FileNumber"
Me.GroupLevel(1).ControlSource ="DateOpened"
Me.GroupLevel(2).ControlSource ="FileName"
Case 3 'LstName
Me.GroupLevel(0).ControlSource ="DateOpened"
Me.GroupLevel(1).ControlSource ="FileName"
Me.GroupLevel(2).ControlSource ="FileNumber"
End Select

Make sure you have predefined 3 grouping levels in your report.

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
ink.net...
Hi Duane,

1 = sort by FileName
2 = sort by FileNumber
3 = sort by DateOpened

Thanks again,
Kathy

"Duane Hookom" wrote in message
...
What are the values in your combo box and what field do these values
correspond with?

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
I'm sorry but that doesn't help me. Perhaps it is too advanced for me.
:-(
Can you, or anyone else, be more specific?
Thank you

"Duane Hookom" wrote in message
...
You might want to check the tip on Allen Browne's site
http://allenbrowne.com/ser-33.html.

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
In an MDE database where users don't have rights to edit the report
design, I would like the user to be able to select the sort order of a
report in a combo box on a form.
How would I tell the report that the sort order is, for example, equal
to [forms]![reportselector]![sortorder] ?

Thanks in advance,
Kathy











  #9  
Old February 1st, 2006, 05:02 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Select Sort Order Through a Form

I couldn't wait to try it, then I got the flu! I finally tried it, and it
works like a charm!!!
Thank you, Duane!
Since I want this same code in 10 reports, how can I put the code in one
place rather than pasting it into the Open Event of 10 reports?

"Duane Hookom" wrote in message
...
Select Case [forms]![reportselector]![sortorder]
Case 1' ID
Me.GroupLevel(0).ControlSource ="FileName"
Me.GroupLevel(1).ControlSource ="FileNumber"
Me.GroupLevel(2).ControlSource ="DateOpened"
Case 2 'Fst Name
Me.GroupLevel(0).ControlSource ="FileNumber"
Me.GroupLevel(1).ControlSource ="DateOpened"
Me.GroupLevel(2).ControlSource ="FileName"
Case 3 'LstName
Me.GroupLevel(0).ControlSource ="DateOpened"
Me.GroupLevel(1).ControlSource ="FileName"
Me.GroupLevel(2).ControlSource ="FileNumber"
End Select

Make sure you have predefined 3 grouping levels in your report.

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
ink.net...
Hi Duane,

1 = sort by FileName
2 = sort by FileNumber
3 = sort by DateOpened

Thanks again,
Kathy

"Duane Hookom" wrote in message
...
What are the values in your combo box and what field do these values
correspond with?

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
I'm sorry but that doesn't help me. Perhaps it is too advanced for me.
:-(
Can you, or anyone else, be more specific?
Thank you

"Duane Hookom" wrote in message
...
You might want to check the tip on Allen Browne's site
http://allenbrowne.com/ser-33.html.

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
In an MDE database where users don't have rights to edit the report
design, I would like the user to be able to select the sort order of
a report in a combo box on a form.
How would I tell the report that the sort order is, for example,
equal to [forms]![reportselector]![sortorder] ?

Thanks in advance,
Kathy













  #10  
Old February 1st, 2006, 05:39 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Select Sort Order Through a Form

I expect you could create a generic function that would pass either the
report object or the report name as an argument.

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
ink.net...
I couldn't wait to try it, then I got the flu! I finally tried it, and it
works like a charm!!!
Thank you, Duane!
Since I want this same code in 10 reports, how can I put the code in one
place rather than pasting it into the Open Event of 10 reports?

"Duane Hookom" wrote in message
...
Select Case [forms]![reportselector]![sortorder]
Case 1' ID
Me.GroupLevel(0).ControlSource ="FileName"
Me.GroupLevel(1).ControlSource ="FileNumber"
Me.GroupLevel(2).ControlSource ="DateOpened"
Case 2 'Fst Name
Me.GroupLevel(0).ControlSource ="FileNumber"
Me.GroupLevel(1).ControlSource ="DateOpened"
Me.GroupLevel(2).ControlSource ="FileName"
Case 3 'LstName
Me.GroupLevel(0).ControlSource ="DateOpened"
Me.GroupLevel(1).ControlSource ="FileName"
Me.GroupLevel(2).ControlSource ="FileNumber"
End Select

Make sure you have predefined 3 grouping levels in your report.

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
ink.net...
Hi Duane,

1 = sort by FileName
2 = sort by FileNumber
3 = sort by DateOpened

Thanks again,
Kathy

"Duane Hookom" wrote in message
...
What are the values in your combo box and what field do these values
correspond with?

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
I'm sorry but that doesn't help me. Perhaps it is too advanced for me.
:-(
Can you, or anyone else, be more specific?
Thank you

"Duane Hookom" wrote in message
...
You might want to check the tip on Allen Browne's site
http://allenbrowne.com/ser-33.html.

--
Duane Hookom
MS Access MVP
--

"Kathy Webster" wrote in message
k.net...
In an MDE database where users don't have rights to edit the report
design, I would like the user to be able to select the sort order of
a report in a combo box on a form.
How would I tell the report that the sort order is, for example,
equal to [forms]![reportselector]![sortorder] ?

Thanks in advance,
Kathy















 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Name order streamlining Stephanie Running & Setting Up Queries 21 February 14th, 2006 06:57 PM
Top 20 and bottom 20 values Brian Camire Running & Setting Up Queries 9 January 8th, 2005 01:36 AM
Dates in a listbox connected to a form... RusCat Using Forms 13 November 25th, 2004 02:31 AM
Setting Sort Order on a combo box in a form. Antony Elson Using Forms 4 September 17th, 2004 11:37 AM
Wrong sort order of report's details section dsjohn_242 Setting Up & Running Reports 6 July 12th, 2004 10:21 PM


All times are GMT +1. The time now is 05:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.