Connecting Tech Pros Worldwide Help | Site Map

Sorting does not transfer to new form.

  #1  
Old May 28th, 2007, 09:15 PM
mark_aok@hotmail.com
Guest
 
Posts: n/a
Hi everyone,

I have a form which contains a datasheet. And I allow the user to
sort it by right clicking on the field, and clicking "Sort Ascending",
or "Sort Descending".

But I also have a button called "Display Results", which brings up a
new window in form view which has a bunch of text boxes for each of
the fields, displaying each item. I have been able to set the record
source correctly. But the sorting is completely wrong.

I have tried determining the orignial forms .Sort, .OrderBy. But
neither property are set. Where can I find the string containing the
CORRECT sorting of the datasheet???

-Mark

  #2  
Old May 28th, 2007, 11:45 PM
fredg
Guest
 
Posts: n/a

re: Sorting does not transfer to new form.


On 28 May 2007 13:05:50 -0700, mark_aok@hotmail.com wrote:
Quote:
Hi everyone,
>
I have a form which contains a datasheet. And I allow the user to
sort it by right clicking on the field, and clicking "Sort Ascending",
or "Sort Descending".
>
But I also have a button called "Display Results", which brings up a
new window in form view which has a bunch of text boxes for each of
the fields, displaying each item. I have been able to set the record
source correctly. But the sorting is completely wrong.
>
I have tried determining the orignial forms .Sort, .OrderBy. But
neither property are set. Where can I find the string containing the
CORRECT sorting of the datasheet???
>
-Mark
To open the second form sorted according to whatever field was
selected on the first form, code the Form1 "Display Results" command
button click event:

DoCmd.OpenForm "Form2", , , , , , Me.OrderBy

Code the Load event of Form2:

If Not IsNull(Me.OpenArgs) Then
Me.OrderBy = Me.OpenArgs
Me.OrderByOn = True
End If

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old May 29th, 2007, 04:15 PM
mark_aok@hotmail.com
Guest
 
Posts: n/a

re: Sorting does not transfer to new form.


On May 28, 6:41 pm, fredg <fgutk...@example.invalidwrote:
Quote:
On 28 May 2007 13:05:50 -0700, mark_...@hotmail.com wrote:
>
>
>
Quote:
Hi everyone,
>
Quote:
I have a form which contains a datasheet. And I allow the user to
sort it by right clicking on the field, and clicking "Sort Ascending",
or "Sort Descending".
>
Quote:
But I also have a button called "Display Results", which brings up a
new window in form view which has a bunch of text boxes for each of
the fields, displaying each item. I have been able to set the record
source correctly. But the sorting is completely wrong.
>
Quote:
I have tried determining the orignial forms .Sort, .OrderBy. But
neither property are set. Where can I find the string containing the
CORRECT sorting of the datasheet???
>
Quote:
-Mark
>
To open the second form sorted according to whatever field was
selected on the first form, code the Form1 "Display Results" command
button click event:
Thanks Fred,

That worked perfectly
-Mark
Quote:
DoCmd.OpenForm "Form2", , , , , , Me.OrderBy
>
Code the Load event of Form2:
>
If Not IsNull(Me.OpenArgs) Then
Me.OrderBy = Me.OpenArgs
Me.OrderByOn = True
End If
>
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 14th, 2005 04:15 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 13th, 2005 11:37 PM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 13th, 2005 09:56 PM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 13th, 2005 03:15 AM