type mismatch error

fayez_MrExcel

Active Member
Joined
Oct 29, 2005
Messages
408
Office Version
  1. 365
Platform
  1. Windows
I have a type mis match error in this syntax, can you help me correct the syntax below please: Note: my table M_tblEmpMaster.empno is set to INTEGER

-----------------------------------------------------
Set rstM_tblEmpMaster = New ADODB.Recordset
rstM_tblEmpMaster.Open "SELECT * FROM M_tblEmpMaster WHERE empno = '" & _
cmbx_EC_empno & "'", _
CurrentProject.Connection, _
adOpenStatic, adLockReadOnly, adCmdText
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

rconverse

Well-known Member
Joined
Nov 29, 2007
Messages
1,187
I have a type mis match error in this syntax, can you help me correct the syntax below please: Note: my table M_tblEmpMaster.empno is set to INTEGER

-----------------------------------------------------
Set rstM_tblEmpMaster = New ADODB.Recordset
rstM_tblEmpMaster.Open "SELECT * FROM M_tblEmpMaster WHERE empno = '" & _
cmbx_EC_empno & "'
", _
CurrentProject.Connection, _
adOpenStatic, adLockReadOnly, adCmdText

By putting that in quotes aren't you changnig your cmbx value to a string or text? I'm thinking, if this is an integer, then you don't need the quotes.

HTH
Roger
 

fayez_MrExcel

Active Member
Joined
Oct 29, 2005
Messages
408
Office Version
  1. 365
Platform
  1. Windows
i dont know exactly, i'll check it, by the way doesn't adCmdText in my syntax has to do with the "miss match error"?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,893
Messages
5,834,272
Members
430,273
Latest member
Windrunner

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top