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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data mismatch error when field is blank

Status
Not open for further replies.

leadman

Programmer
Jun 11, 2001
177
US
Hi all,
the following query:

INSERT INTO
Ccdatabase (strProdID, PubID, AuthorID, memDescription, strKeywords)
VALUES ('#form.strProdID#', '#form.PubID#', '#form.AuthorID#', '#form.memDescription#', '#form.strKeywords#')

has been returning the following error if either the PubID or AuthorID is passed a zero length string:

ODBC Error Code = 22005 (Error in assignment)

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression

If I put the number 1 (or any other number) in for these variables the query works fine but id like it to work whether or not it gets a value for these from the form. the fields. The datatype for both is set to long integer and i have "no" for required. Any ideas?
 
that may help - but cant i just have the cell empty if the field is blank?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top