By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,603 Members | 976 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,603 IT Pros & Developers. It's quick & easy.

Sorting does not transfer to new form.

P: 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

May 28 '07 #1
Share this Question
Share on Google+
2 Replies

P: n/a
On 28 May 2007 13:05:50 -0700, ma******@hotmail.com wrote:
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
May 28 '07 #2

P: n/a
On May 28, 6:41 pm, fredg <fgutk...@example.invalidwrote:
On 28 May 2007 13:05:50 -0700, mark_...@hotmail.com wrote:
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:
Thanks Fred,

That worked perfectly
-Mark
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

May 29 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.