W
WebDude
hello again
I have a continuous form, based on a table/query. I created a button on that
form;
me.form.orderby = "[LastName]"
me.form.orderbyon = true
and another button with;
me.form.orderby = "[FirstName]"
me.form.orderbyon = true
and they both work fine!
However, i have a text field called "Age" placed on the same continous form,
which takes the value in the "BirthDate" field of the table and calculates
the age. So, i added a button on the same form and put;
me.form.orderby = "[Age]"
me.form.orderbyon = true
but when i run the continuous form, it asks for the value of "age" when i
ran the form. So i changed it to;
me.form.orderby = "Age"
me.form.orderbyon = true
but again it prompts me with a dialogue asking for the value of "Age".
so i tried several different combinations;
me.form.orderby = "me.[Age]"
me.form.orderby = me.Age
me.form.orderby = me.form.Age
...etc, etc etc
None of them sorted the records by the "Age" field i placed on the
continuous form.
Coincidentally,the [Birthdate] table field that is also on the same form has
a format of mmmm dd", "yyyy - but id like to sort the records based on
the DAY value of the birthdate ONLY - ignoring the month, and year values.
So i thought i was smart in scipting this to a button for sorting the records;
Me.Form.OrderBy = "Format([Birthdate], 'dd')"
Me.Form.OrderbyOn = true
me.form.refresh
but um. that didnt work either. so then i created a field on the same form,
named it BirthDayText, with the control source "=Format([Birthdate],"dd")"
and when i run the form, the correct number appears in the field, but i have
the same problems sorting it.
Me.Form.OrderBy = "[BirthDayText]"
me.Form.Orderbyon = true
wont work.
Oh! i even added... me.form.refresh and me.form.requery at the end of every
sort , but still no go.
Any comments or suggestions?
Cheers,
Jeff
I have a continuous form, based on a table/query. I created a button on that
form;
me.form.orderby = "[LastName]"
me.form.orderbyon = true
and another button with;
me.form.orderby = "[FirstName]"
me.form.orderbyon = true
and they both work fine!
However, i have a text field called "Age" placed on the same continous form,
which takes the value in the "BirthDate" field of the table and calculates
the age. So, i added a button on the same form and put;
me.form.orderby = "[Age]"
me.form.orderbyon = true
but when i run the continuous form, it asks for the value of "age" when i
ran the form. So i changed it to;
me.form.orderby = "Age"
me.form.orderbyon = true
but again it prompts me with a dialogue asking for the value of "Age".
so i tried several different combinations;
me.form.orderby = "me.[Age]"
me.form.orderby = me.Age
me.form.orderby = me.form.Age
...etc, etc etc
None of them sorted the records by the "Age" field i placed on the
continuous form.
Coincidentally,the [Birthdate] table field that is also on the same form has
a format of mmmm dd", "yyyy - but id like to sort the records based on
the DAY value of the birthdate ONLY - ignoring the month, and year values.
So i thought i was smart in scipting this to a button for sorting the records;
Me.Form.OrderBy = "Format([Birthdate], 'dd')"
Me.Form.OrderbyOn = true
me.form.refresh
but um. that didnt work either. so then i created a field on the same form,
named it BirthDayText, with the control source "=Format([Birthdate],"dd")"
and when i run the form, the correct number appears in the field, but i have
the same problems sorting it.
Me.Form.OrderBy = "[BirthDayText]"
me.Form.Orderbyon = true
wont work.
Oh! i even added... me.form.refresh and me.form.requery at the end of every
sort , but still no go.
Any comments or suggestions?
Cheers,
Jeff