Calculation in a query

  • Thread starter Thread starter Peggy
  • Start date Start date
P

Peggy

I hope I can describe this correctly. In my query I am
attempting a calculated field. If I enter it this way,

([combobox value from tbl1]+[currency from tbl2])-
[currency from tbl2]

Where combobox and currency are the properties.

I get the value I am after.

However, if I enter it this way

([combobox value from tbl1]+[combobox value from tbl2])-
[combobox value from tbl2]

When I run the query, for this field I get ##Error.

I would like the user to be able to use comboboxes so they
don't have to type an entry. Is this possible?
 
I hope I can describe this correctly. In my query I am
attempting a calculated field. If I enter it this way,

([combobox value from tbl1]+[currency from tbl2])-
[currency from tbl2]

You're another victim of Microsoft's misdesigned, misleading, and all
but useless so-called Lookup Wizard.

Table1 DOES NOT CONTAIN A COMBO BOX. Neither does Table2.

It contains a numeric ID, linked to another table (the lookup table).
That basic fact is concealed from your view by the combo box!
Where combobox and currency are the properties.

A combo box is a display tool, not a property!
I get the value I am after.

However, if I enter it this way

([combobox value from tbl1]+[combobox value from tbl2])-
[combobox value from tbl2]

When I run the query, for this field I get ##Error.

I would like the user to be able to use comboboxes so they
don't have to type an entry. Is this possible?

Of course. *Use a FORM* to enter and edit data, not a table datasheet.
Put your combo box on the Form, and have it store the numeric foreign
key in your table.
 
Back
Top