Length & Width

esskaykay

Registered User.
Local time
Today, 07:22
Joined
Mar 8, 2003
Messages
267
I've notice a situation in a few database's we have. One is where we track sidewalk construction. There are two called fields LENGTH and WIDTH. In my report I have text box with the control source =[Length]*[Width]. However it returns some bogus number. If I change the field names to something else like Width1, it works fine. Any ideas?

Thanks,
SKK
 
Both Length and Width are reserved words in Access.

It appears the [Width] is referring to the Report’s property width not the field value.

Best to avoid reserved words altogether.

Hope that helps.

Regards,
Chris.
 
Thanks Chris, I will use Length1 and Width1.
Is there a listing of "reserved words"?

Thanks again,
SKK
 
Yes here.

The problem is that the list will expand over time so you are better off taking another route.

Try to make field names in tables more descriptive. For example Width could better be described as PlankWidth, Date could better be described as InvoiceDate and so on…

Now when the wizard generates Forms and Reports for us it uses the Field name in the Table as the Control name. Please don’t accept that either. Try to prefix the Control name with a good naming convention. For example a text box for Field PlankWidth would become txtPlankWidth and Field InvoiceDate would become txtInvoiceDate.

For a good standard try these.

The other thing I would suggest is don’t go overboard with naming conventions. To do so will require your readers to carry a dictionary to read your code and they might have the wrong dictionary.

Hope that helps.

Regards,
Chris.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom