469,582 Members | 2,457 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,582 developers. It's quick & easy.

Sorting records by an unbound column

I have a continuous form has an unbound field named "Client". Its
controlsource is " =[ClientID].[Column](1) " This allows me to display the
client name without the combo box dropdown arrow. I want users to be able to
sort the records by the client name but I am unable to figure out how to
reference this in my code.

If I used the following code, I can sort the recoreds based on [ClientID]
but this does not sort based on the text in column 1, rather the number in
column 0: Me.OrderBy = "[ClientID] ASC"

I tried using Me.OrderBy = "[ClientID].column(1) ASC" but no go. Error says
that '[ClientID].column' is an undefined function.

I also tried simply using the name of the field [Client]... Me.OrderBy =
"[Client] ASC" but access wants me to enter a value when I activate the
sort.

Any thoughts?
Sep 14 '06 #1
1 3109
you can link the two tables (the data table, and the table that contains
client names) in a query, and bind the query to the form. create a
calculated field in the query to show the client name. now you have a field
in the form's RecordSource that can be used to sort. and if you set up the
query with an outer join, *from* the data table *to* the client-names table,
you will probably still be able to add/edit/delete records in the form;
you'll have to test it to know for sure.

hth
"Jimmy Stewart" <no**@none.comwrote in message
news:tX*********************@fe08.news.easynews.co m...
I have a continuous form has an unbound field named "Client". Its
controlsource is " =[ClientID].[Column](1) " This allows me to display the
client name without the combo box dropdown arrow. I want users to be able
to
sort the records by the client name but I am unable to figure out how to
reference this in my code.

If I used the following code, I can sort the recoreds based on [ClientID]
but this does not sort based on the text in column 1, rather the number in
column 0: Me.OrderBy = "[ClientID] ASC"

I tried using Me.OrderBy = "[ClientID].column(1) ASC" but no go. Error
says
that '[ClientID].column' is an undefined function.

I also tried simply using the name of the field [Client]... Me.OrderBy =
"[Client] ASC" but access wants me to enter a value when I activate the
sort.

Any thoughts?


Sep 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by saleek | last post: by
19 posts views Thread by Owen T. Soroke | last post: by
5 posts views Thread by jean.ulrich | last post: by
reply views Thread by robin9876 | last post: by
7 posts views Thread by Kamal | last post: by
4 posts views Thread by ReneMarxis | last post: by
5 posts views Thread by jrod11 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.