#Error in a calculated control usually indicates a syntax error in the formula, formula itself returned an error, or the use of the formula is not appropriate for the control.
Don't use the dlookup() in a combobox - this will not work as expected
You must understand the nature of a combobox:
Customize a list box, combo box, or drop-down list box
Typically, one has a table with a one to many relationship with another table and you want to show the human readable text from the second table such as:
[tbl_parent]
[PK](autonumber)
[fk_comboboxlist](numeric(long))
{other fields}
[tbl_comboboxlist]
[PK](autonumber)
[description] (text(25)]
So you have a form such that:
- {form title}
-
{label} {label2} {lable3}
-
{textbox} {combobox2} {textbox3}
-
You want the {combobox2} to show the
[tbl_comboboxlist]![description] value however because the
[tbl_parent]![fk_comboboxlist] is long the {combobox2} needs to actually have the [tbl_comboboxlist]![PK] as its value.
The simplest method is done by:
Set {combobox2} control source to [tbl_parent]![fk_comboboxlist]
Set {combobox2} row source type to "table/query"
Set {combobox2} row source to [tbl_comboboxlist]
Set {combobox2} bound column to 1
Set {combobox2} number of columns to 2
Set {combobox2} column widths to 0,1
The tutorial above will give much more detail.
What you have to keep in mind is that the bound column is the value that will be returned from the rowsource property to the control source. If it is blank, then your combobox is returning nothing. You need to have it set to the [field] of data in the rowsource that is required in your recordset.
It is very important that you understand that the CONTROL SOURCE is NOT the same as ROW SOURCE in a combo/list box. Normally the two are only related in that the bound column of the ROW SOURCE must return a value that is of the correct typecast as the field to which the cbo's CONTROL SOURCE is set (bound).
There is another method with multi-column record sources that you could use read thru this:
How to select Records in an Access Subform from a Combo Box it's a bit of an overkill so don't worry if you don't follow somehthing, just ask back here and we'll clear it up (^_^)