Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"#type!" error on report calculated field

I have a report in Access with 3 fields on it: Width, Height and Area.
Width and Height are pulled from the table the report is bound to, whilst Area should be calculated (height * width). I've set the Control Source of the Area to = [Height] * [Width], but on opening the form the field displays #Type!, in typically descriptive Access errors fashion, with nice use of # and ! to make it impossible to accurately Google... but I digress. I have no idea what #Type! means and Access doesn't want to tell me.

I can't understand this. In the bound table, Height and Width are Integers, and are both populated in the record being viewed (so it's not a NULL problem). If I change the Control Source to something really simple - like =[Height], it spits out #Error! instead (again, thanks for the useful intel, Access. We'd be lost without you). Even = 1 spits out #Error!.

Any idea why Access hates my control sources?

like image 373
Kai Avatar asked Oct 31 '13 15:10

Kai


People also ask

What do 2 quotation marks mean?

Double quotation marks are used for direct quotations and titles of compositions such as books, plays, movies, songs, lectures and TV shows. They also can be used to indicate irony and introduce an unfamiliar term or nickname. Single quotation marks are used for a quote within a quote.

What is quotation mark used for?

The primary function of quotation marks is to set off and represent exact language (either spoken or written) that has come from somebody else. The quotation mark is also used to designate speech acts in fiction and sometimes poetry.

What is the 1 quotation mark called?

Single quotation marks are also known as 'quote marks', 'quotes', 'speech marks' or 'inverted commas'. Use them to: show direct speech and the quoted work of other writers. enclose the title of certain works.

What are double quotations called?

The double quotation mark is identical to the ditto mark in English-language usage. It is also similar to—and often used to represent—the double prime symbol.


2 Answers

You probably have a name clash, i.e. Access is picking up the Width and Height members of the report object rather than the fields called Width and Height.

I would create a new query and simply rename the problematic fields in it. So, if you're using the query designer:

  • add the primary key and any other non-problematic field, then WidthValue: Width and HeightValue: Height as additional columns;
  • finally, set the report's record source to be the query rather than the table directly, and update the calculated control formulae accordingly.
like image 65
Chris Rolliston Avatar answered Oct 19 '22 20:10

Chris Rolliston


This is a pretty simplistic calculation. Any reason why you don't create a query, do the calculation in said query, and bind the report to the query instead? No sense killing yourself trying to figure this out.

In fact, now that I'm thinking about it, Height and Width are probably reserved words, as they're properties of a control. Maybe change them to HHeight and WWidth or something?

like image 3
Johnny Bones Avatar answered Oct 19 '22 21:10

Johnny Bones