Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting 1

Status
Not open for further replies.

janetlyn

Technical User
Jan 29, 2003
516
US
I have read a few threads saying I can sort using

=Val([RecipeID])

I cannot figure out where to put this "code" so it will sort my stuff correctly, (i.e. A11, A12, A13, A14, A15, A16, A17, A18, A19, A1) should be with the A1 first.

Thanks for any help. JL
 
Try set the sorting and grouping expression to:
=Left(RecipeID,1) & Format(Val(Mid([RecipeID],2)),"000")
This assumes there is always a single letter followed by up to 3 numbers.



Duane
MS Access MVP
 
But WHERE do I type in what you have suggested? And thanks for your help. JL
 
Open the report's Sorting and Grouping dialog. Enter the expression in the Field/Expression.

Duane
MS Access MVP
 
Duane, I typed in the expression (substituting the correct ID name) and when I went to preview the report, I get this error message,

"You must define a sort field or expression for the group header or footer in the report you tried to preview or print."

Do you know what I did wrong? Thanks so much for your help, Janet Lyn
 
Duane, I found another thread where you told the person to type

=Val([FoodCatID])

It worked great. Thanks for your help. Pink star for you. Janet Lyn
 
I wasn't sure if the letter would ever be some value other than A.

Duane
MS Access MVP
 
I should have been more specific. But, you helped anyway so thanks. Have a wonderful day. JL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top