The information in this article applies to:
Moderate: Requires basic macro, coding, and interoperability skills. This article applies only to a Microsoft Access database (.mdb). SUMMARY
When you concatenate variables or controls in a function or OpenRecordset method, you may receive one of the following error messages.
-or-
-or-
MORE INFORMATIONThese error messages can occur if one of the following is true:
NOTE: The sample code in this article uses Microsoft Data Access Objects. For this code to run properly, you need to reference the Microsoft DAO 3.6 Object Library. Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web: http://www.microsoft.com/mcsp/For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.asp Microsoft Jet Engine error (3070) or "Can't bind name '<argument>'" ErrorYou may receive the Microsoft Jet Engine error message or the "Can't bind name '<argument>'" error message when you concatenate a variable or control that has a String data type in a method or function as a Numeric data type. For example, the following sample function produces one of these error messages:
To call this function type the following in the Immediate window, and then press ENTER:
The correct syntax for the last line of the code above is as follows:
"Type Mismatch" or "Data Type Mismatch in Criteria Expression" ErrorYou may receive the "Type Mismatch" or "Data Type Mismatch in Criteria Expression" error message when you concatenate a variable or control that has a Numeric data type in a method or function as a String data type. For example, the following function produces one of these error messages:
To call this function, type the following in the Immediate window, and then press ENTER:
The correct syntax for the next to the last line of the code above is as
follows:
Keep the following requirements in mind:
"Too few parameters. Expected 1" ErrorYou may receive this error message when you use the OpenRecordset method in code on an existing query. If the query is a parameter query, you need to explicitly declare the parameter and its data type, and set the parameter value for that query in the function.For example in Query1, which includes fields from the Employees table in the sample database Northwind.mdb, the following sample code generates the error message when Query1 has the parameter "[Enter a City]" in the criteria for the [City] field:
When you refer to the parameter query, the correct syntax is as follows:
The same error message may appear when you concatenate a variable in the
SQL SELECT statement of an OpenRecordset method. A syntactically correct example is as follows:
This SELECT statement points to a control on a form for the WHERE clause. [City] is a Text field type and the contents of the control are Text. Additional query words: inf parameters
Keywords : kberrmsg kbprg kbdta AccCon |
Last Reviewed: July 6, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |