4 Replies - 358 Views - Last Post: 14 September 2012 - 12:48 PM Rate Topic: -----

#1 pathllk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 26-July 11

ERROR IN FILTER DATA

Posted 14 September 2012 - 12:11 PM

Dear Friends I got Error Msg i.e. "Data type mismatch in criteria expression." for the given below code:
RS.Open("select * from mainpopu where ens='" & TXT3.Text & "'", CON, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)



I use MS Access Database and the "ENS" is a number field in the database. Please friends suggest me the right code for the above.

Is This A Good Question/Topic? 0
  • +

Replies To: ERROR IN FILTER DATA

#2 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: ERROR IN FILTER DATA

Posted 14 September 2012 - 12:25 PM

Remove the apostrophes. Numeric fields do not get wrapped in apostrophes
Was This Post Helpful? 0
  • +
  • -

#3 pathllk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 26-July 11

Re: ERROR IN FILTER DATA

Posted 14 September 2012 - 12:33 PM

View PostCharlieMay, on 14 September 2012 - 12:25 PM, said:

Remove the apostrophes. Numeric fields do not get wrapped in apostrophes


Not Working CharlieMay
Was This Post Helpful? 0
  • +
  • -

#4 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: ERROR IN FILTER DATA

Posted 14 September 2012 - 12:37 PM

Let's see what you changed it to.

Also, show me an example of what Txt3.Text contains.

You might also benefit from this tutorial.

This post has been edited by CharlieMay: 14 September 2012 - 12:43 PM

Was This Post Helpful? 0
  • +
  • -

#5 pathllk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 26-July 11

Re: ERROR IN FILTER DATA

Posted 14 September 2012 - 12:48 PM

View PostCharlieMay, on 14 September 2012 - 12:37 PM, said:

Let's see what you changed it to.

Also, show me an example of what Txt3.Text contains.

You might also benefit from this tutorial.


Thank you CharlieMay. your trick helps me great.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1