Sorting a Lookup field on Subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

A have a form (member information) that has a subform included
(registration). The first column of the subform is a lookup field that allows
you to choose a date in the format dd/mm/yyyy. I want the subform to be
sorted by this date column, if I manually select the column and click the
sort ascending button then it works fine, however even if I save this and
then reopen the main form, the subform goes back to a mixed up order.

If I look at the same subform from the database window without viewing it
via the main form then the sort saves, it only does not save when viewing it
as an embedded subform within the member information form. (hope that bit
makes sense).

I have looked up the 'Orderby' property but Im not sure if I should be using
this and even if I am supposed to i would not have a clue what to write and
where.

Any help will be much appreciated.
 
SELECT Registration.[Reg ID], Registration.Date, Registration.[Session Type],
Registration.Description FROM Registration;
 
SELECT Registration.[Reg ID], Registration.Date, Registration.[Session Type],
Registration.Description
FROM Registration
ORDER BY Registration.Date;

Scooby said:
SELECT Registration.[Reg ID], Registration.Date, Registration.[Session Type],
Registration.Description FROM Registration;

KARL DEWEY said:
Post your record source for the lookup field.
 
Thanks for the reply, however it still does not seem to be working, Is there
a property I need to change or maybe I have missed.

I just find it strange that it sorts correctly when I manually select it and
click the sort button but I can't seem to set it to be sorted automaically.

KARL DEWEY said:
SELECT Registration.[Reg ID], Registration.Date, Registration.[Session Type],
Registration.Description
FROM Registration
ORDER BY Registration.Date;

Scooby said:
SELECT Registration.[Reg ID], Registration.Date, Registration.[Session Type],
Registration.Description FROM Registration;

KARL DEWEY said:
Post your record source for the lookup field.

:

A have a form (member information) that has a subform included
(registration). The first column of the subform is a lookup field that allows
you to choose a date in the format dd/mm/yyyy. I want the subform to be
sorted by this date column, if I manually select the column and click the
sort ascending button then it works fine, however even if I save this and
then reopen the main form, the subform goes back to a mixed up order.

If I look at the same subform from the database window without viewing it
via the main form then the sort saves, it only does not save when viewing it
as an embedded subform within the member information form. (hope that bit
makes sense).

I have looked up the 'Orderby' property but Im not sure if I should be using
this and even if I am supposed to i would not have a clue what to write and
where.

Any help will be much appreciated.
 
I think I have sorted it, I changed the property of 'fetch defaults' on the
main form to 'no' and it has saved the sort changes. Not sure if that was
supposed to happen.

Scooby said:
Thanks for the reply, however it still does not seem to be working, Is there
a property I need to change or maybe I have missed.

I just find it strange that it sorts correctly when I manually select it and
click the sort button but I can't seem to set it to be sorted automaically.

KARL DEWEY said:
SELECT Registration.[Reg ID], Registration.Date, Registration.[Session Type],
Registration.Description
FROM Registration
ORDER BY Registration.Date;

Scooby said:
SELECT Registration.[Reg ID], Registration.Date, Registration.[Session Type],
Registration.Description FROM Registration;

:

Post your record source for the lookup field.

:

A have a form (member information) that has a subform included
(registration). The first column of the subform is a lookup field that allows
you to choose a date in the format dd/mm/yyyy. I want the subform to be
sorted by this date column, if I manually select the column and click the
sort ascending button then it works fine, however even if I save this and
then reopen the main form, the subform goes back to a mixed up order.

If I look at the same subform from the database window without viewing it
via the main form then the sort saves, it only does not save when viewing it
as an embedded subform within the member information form. (hope that bit
makes sense).

I have looked up the 'Orderby' property but Im not sure if I should be using
this and even if I am supposed to i would not have a clue what to write and
where.

Any help will be much appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Sort Data on a Form and Subform 5
Subform Lookup 1
Using Combobox to Sort subform 4
Problem with form--subform 5
Access Daily Entry with multiple entries per field 0
Filtering a Lookup Box 4
Access Main form/Subform Navigation 0
Lookup Box 8

Back
Top