Hello all,
It's my first database, and I have a query that shows me the quantity,
material, length, width and thicknesses of parts, and I'm using these
figures to do some arithmetic on a report to show me how many board
feet of lumber to buy (expression is as follows):
=([Length] * [Width] * [Quantity]/144) * (Val([Thickness])/4)
If you're wondering what the Val statement is for, it's to grab the
first number of a fraction that's recorded as a text field for rough
lumber sizes like 4/4, 8/4, 12/4, et cetera, and I use the first number
of that fraction as a multiplier. This may not be the best way to get
the number, but it's what I've come up with.
The data in the table looks right, and the query shows me the right
data as well. The problem seems to be in the report.
Everything about the report's expression gives me the answer I expect,
except the width field. For some reason, the expression always uses a
width value of 9360, regardless of the width data in my table. I have
no idea where this number comes from. It's not a value in any of my
tables, and is not a sum of any values either. As a test, I copied the
database, blew away all the data in the copy's table and the report
still came back with a width value of 9360. Even changing the
expression to =[Width] gives me 9360, but just Width (no equal sign or
brackets) yields the correct number.
I am very puzzled. If anyone can shed some light on this, I would be
grateful. Let me know if I omitted a crucial piece of information.
Jared Emery
Randy Harris - 11 Jan 2006 21:34 GMT
I don't know if this is the cause of the problem, but Width is an Access
reserved word. I'd try changing the name of that field.

Signature
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
fredg - 11 Jan 2006 22:06 GMT
> Hello all,
>
[quoted text clipped - 28 lines]
>
> Jared Emery
You have used a reserved word "Width" and you are getting the width
(in Twips) of an Access object.
Width is a reserved Access/VBA/Jet word and should not be used as a
field name.
For additional reserved words, see the Microsoft KnowledgeBase article
for your version of Access:
109312 'Reserved Words in Microsoft Access' for Access 97
209187 'ACC2000: Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'
321266 'ACC2002: Microsoft Jet 4.0 Reserved Words'

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
JaredEmery - 11 Jan 2006 22:20 GMT
Holy secret passwords Batman, there's no WAY I would've figured that
out on my own. Thank you kindly. Now I can attempt to put the hair back
on my scalp.
Jared
Terry Kreft - 13 Jan 2006 15:07 GMT
I see your main problem has been answered. On the 12/4, 8/4, 4/4 entries
have a look at using Eval.
so your equation becomes
=([Length] * [Width] * [Quantity]/144) * Eval([Thickness])
Except of course you'll be changing the Width keyword.

Signature
Terry Kreft
> Hello all,
>
[quoted text clipped - 10 lines]
> of that fraction as a multiplier. This may not be the best way to get
> the number, but it's what I've come up with.
<SNIP>
> Jared Emery