Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BuildCriteria: Invalid Data Type

Status
Not open for further replies.

jgoodman00

Programmer
Jan 23, 2001
1,510
Ok, I am attempting to use this, to parse a criteria string:
strWhere = strWhere & strJoinType & (BuildCriteria(strField, strFieldType, strExpression))
This works fine, until it encounters a varchar datatype (ADO.DataTypeEnum = adVarChar or 200). At this point it errors, stating 'Invalid Data Type'.

An example of the contents of the BuildCriteria string are as follows:
BuildCriteria("NewFenceType","200","GP24")

I have also tried assigning strFieldType as an Integer, but it makes no difference.

If I use the query designer grid I get no error.

James Goodman MCP
 
My guess is that the BuildCriteria function has not kept up with additional datatypes.

You can probably make a VBA wrapper function that maps adVarChar into some complimentary type and then calls BuildCriteria.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top