hide the "0" at left

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

Guest

i'm building a table of adress, and wanted to build a corresponding report,
but I have the following problem:
I wanted the order the records by door number, and when I do it, the records
will only be realy ordered if I put the "0's" at left (ex: 001, 022,111).
I was trying to hide the "0" in the report but can't find out how to.
does anyone know how to do it?
 
You don't give us much to go on, but you could add a calculated field to the
query similar to this:
SortField: Val([DoorNumber])
and sort Ascending on this field.

It sounds as if the DoorNumber field is a text field, so your sort on that
field goes with text sorting, not numeric value sorting.
 
For demonstration purposes, I've used the Intermediate window ...

? cstr(val("012"))
12

.... In the Control Source property of a text box, it would looks something
like ...

= CStr(Val([DoorNumber]))

The CStr function isn't strictly necessary in most circumstances, you can
probably get away with just =Val([DoorNumber]). Val returns a Double, which
may or may not be important, depending on the circumstances. Use CStr when
you need to explicitly convert the return value back to a String again.
 

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

Back
Top