That did it! Thank you so much for your help. Marshall, you do a great job of writing your recommendations clearly so even the novice can follow your advice. Keep up the good work! -- Linda
"Marshall Barton" wrote:
[Quoted Text] > Linda wrote: > > > > >I did find that the risk exposure was defined as a string and I was making > >calculations with it as a number. Once I went through an repopulated the > >field with the correct type the sorting appears to work correctly. Thank you > >for that pointer! > > > >Now, my Risk_Exp_Lvl contains vaules like High, Medium, Low and None. How > >do I sort them in that order? Alphabetically doesn't do it. > > > The database way of doing that kind of sort is to create a > simple little table with two fields: > > Table: RiskLevels > Fields: Key Integer > Descr Text > Then populate it with records like: > 1 High > 2 Medium > 3 Low > 4 None > > This simple arrangement allows you to use a combo box on a > form to select the risk level so users can not make up their > own descriptions of risk and it also eliminates the chance > of spelling errors. > > Your existing table should then be changed to use the > RiskLevels table's Key field instead of your current Text > field. I.e. the combo box's BoundColumn would be the Key > field, but would display the Descr field. At this point the > sorting you need is trivial. > > To display the text in a report, the report will need to use > a query as its record source. The query would simply join > the RiskLevels table to your existing table to pick up the > Descriptive text. > > One major additional benefit of this seemingly "extra" > effort is that you can change the descriptive text without > changing anything in your queries, forms or reports. Adding > additional risk levels would also be a code/form/report free > change. > > -- > Marsh > MVP [MS Access] >
|