Connecting Tech Pros Worldwide Forums | Help | Site Map

Sorting does not transfer to new form.

mark_aok@hotmail.com
Guest
 
Posts: n/a
#1: May 28 '07
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


fredg
Guest
 
Posts: n/a
#2: May 28 '07

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
mark_aok@hotmail.com
Guest
 
Posts: n/a
#3: May 29 '07

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