Newbie needing help - List box output from Report

Ginny2222

Ginny
Local time
Today, 04:26
Joined
Oct 27, 2007
Messages
108
Hi all,
I have a number of list boxes outputting data in my reports. The underlying queries have all number formats set to Standard, 0 decimal points. I have done this using the properties box in the queries. The report is outputting the data with 2 decimal points. Is there an easy way to change this?
Ginny
 
There probably is Ginny. I believe, by default, Access generates number fields in reports using the "Auto" Decimal Format. So it's probably following the program settings somehow. I know this is what happens when you use currencies. You can change it by setting the decimal property of the field controls to 0 (in the report). It's in the Format tab under properties.

Or, you can use a report event and specify...
Code:
Me.FieldControlName.DecimalPlaces = 0
 
Ginny - just an FYI for you. Access does not hold formatting from object to object, with limited exceptions. So, you always should format the object at the point at which you use it. If you use it in a report, format it in the report. If you use it in a form, format it at form level.
 
Hi again,

I have looked for the "decimal property of the field controls" in the Design View of my Report. It's not there, I'm afraid. I'm working in Access 2000. I have checked the Report, Detail and List Box Properties. There are no options for changing number formats. I thought maybe it was pulling from the operating system options, but I have tried changing those, restarting PC etc. but to no avail.

Ginny
 
There's not a "Decimal" property, but in the format you select STANDARD and then set, the DECIMAL PLACES property. Just make sure you are looking in the right spot. I have worked in Access 2000 (and currently have it too) and it is there. If you still can't find it I'll try to take a screenshot for you.
 
adding number format

Hi Bob,

I have opened the report in Design view. I have a number of list box controls + labels, a couple of textboxes. I can't see any reference to STANDARD on the format tab in Properties for any of the items selected. I've attached what is available on the properties --> format of the Report. Is it usually on this screen?

rgs
Ginny
 

Attachments

  • Report.jpg
    Report.jpg
    49 KB · Views: 145
The problem is that you have selected the report. You have to select the individual controls you want formatted. The properties will then change to include the format and decimal places.
 
I looked again and I realised that on the Text box there is the option of changing the format and working with Decimals, but I can't find the same options with List Boxes.
Screen attached.

Ginny
 

Attachments

  • formatOptions.jpg
    formatOptions.jpg
    61.1 KB · Views: 141
For list boxes you would have to format it in the underlying query.
 
You would do this by actually doing it in the field (not the table) - you would create a name:

MyNewName:Format([YourFieldNameHere],"0.00")
 
Ok, that appears to be the only way to do it. Thanks for that.

rgs
Ginny
 

Users who are viewing this thread

Back
Top Bottom