Link to home
Start Free TrialLog in
Avatar of JedNebula
JedNebulaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Fields with large data show ##### rather than data.

I have some reports within an Access 2007 Application that show lots of hashes instead of data when the number is too big to be formatted...
User generated imageIs there a way of catching this as an event or adding something into the Format Event to catch this and change the font size or do something with it rather than see the ugly error?

Thank you in advance,

Jed Nebula
Avatar of clarkscott
clarkscott
Flag of United States of America image

Your best bet is to simply make the text box as wide as it can possibly be.  Text boxes are not font and size specific, plus, you'd have to examine all the data in the source to pre-determine how large to make this (or each) text box.

Scott C
If you are seeing a lot of these, the simplest solution is to increase the width of those columns to accommodate the largest expected numbers.

However, code in the detail format event might be:

If len([Count] & "") > 6 then 
       Me.txtCount.FontSize = 5
Else
       Me.txtCount.FontSize = 10
End if

Open in new window


My personal choice here would be simply to increase the column width.  This would look better than different font sizes or control widths in the same column.
Avatar of JedNebula

ASKER

I know what you mean. I find though that you can have a report that is running low on real estate and so you use a column size that fits in with 99.95% of your customers (their data will show things like 2 and 25 or even 250) but you have this one customer where they suddenly want to fit 250,999 in the field for whatever reason. You are then creating the report with wider than necessary columns just for that one customer and have to listen to 99.95% of your customers say "why don't you just make the column smaller?"...

Jed
Is printing in landscape view an option?
Or sizing down the font for the report as a whole?
It's already a Landscape report.

Seems strange that Access would work hard enough to change your data to look like ####### but not build that into an event you could catch the error and do something about it.

Jed
No hard work. It is quite easy for Access to create the ##### string.

If you wish data to be displayed, you have no other option than to provide the space.
If not ##### was displayed, false data would be displayed, like 999 for 250999.

/gustav
Another alternative is to set the "Can Grow" property of your textbox to YES, but that will wrap your text (not optimal for numeric data) and make the row height inconsistent between records.
Can you set the Textbox to CanGrow = True?
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the display of ###### is NOT an 'error' which is catchable. It is being displayed as ###### because the number is TOO LARGE (has too many characters) for the size of the text-box.  

If the display is a bound form (a table or query is bound to the display), and is not being controlled by your code, then there is very little that you can do to change this appearance.

AW
Jed,

Comparing your report to some of my (landscape) reports, you should be able to fit *much more* data into your report line than is shown. I could be wrong, but my guess is that, as mbizup already alluded to, you are using a larger font size that is necessary and/or that your report boundaries are much too narrow for landscape (i.e. the report margins are too large and/or the report width is too narrow).

Try this:
Font: Arial 8 (normal)
Margins (left and right) = 0
Report width upto 26.7cm (10.5 inch)
Place all invisible fields, if you have any, inside visible fields.
(I use these settings regularly)

All these should enable you to widen the 'Count' column.

Jacob
This was as near as I was going to get. Thank you.