ACC2000: Ambiguous Error When Running a Make-Table Query (197587)
The information in this article applies to:
This article was previously published under Q197587 Novice: Requires knowledge of the user interface on single-user computers.
SYMPTOMS
When you run a make-table query that has an outer join between two tables,
you may receive the following error message:
You tried to assign the Null value to a variable that is not
a Variant data type.
The error message does not clearly state the exact problem with the query
design.
CAUSE
The query is trying to populate a table where a field contains a Null value and the data type is AutoNumber.
RESOLUTION
Use either of the following methods to work around this behavior.
Method 1
If you do not need the data returned by the AutoNumber field, omit that
field from the query.
Method 2
By modifying your existing query, you can create a new table and use an
append query to populate the table. To do so, follow these steps.
Creating a Table with the Same Structure- After clicking OK on the error message described in the "Symptoms" section, the query will be in Design view. Double-click the join line and select the following property for the join:
Only include rows where the joined fields from both tables are
equal.
- On the Query menu, click Run.
- A dialog box will advise you that you are about to paste a number of
records into the new table; click Yes.
- Save the query as qryTest.
- In the Database window, select the newly created table.
- On the Edit menu, click Copy.
- On the Edit menu, click Paste.
- In the Paste Table As dialog box, type tblTest in the Table Name text box.
- Click the Structure Only option, and click OK.
- Open the tblTest table in Design view.
- Change any fields whose data type is AutoNumber to Number.
- Close the tblTest table and click Yes in the Save Changes dialog box.
Appending the Records- Open the qryTest query in Design view.
- Double-click the join line and select the following property for the
join:
Include ALL records from 'Customers' and only those records from
'Orders' where the join fields are equal.
- On the Query menu, click Append Query.
- On the Query menu, click Run.
- A dialog box will advise you that you are about to paste a number of
records into the new table; click Yes.
Note that the tblTest table now contains the desired records.
REFERENCESFor more information about query joins, click Microsoft Access Help on the Help menu, type Join types andhow they affect query results in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
Modification Type: | Major | Last Reviewed: | 6/24/2004 |
---|
Keywords: | kbprb KB197587 |
---|
|