type mismatch error

fayez_MrExcel

Active Member
Joined
Oct 29, 2005
Messages
437
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

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
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
 
Upvote 0
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"?
 
Upvote 0

Forum statistics

Threads
1,214,387
Messages
6,119,208
Members
448,874
Latest member
Lancelots

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
Back
Top