type mismatch error

fayez_MrExcel

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

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

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
394
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"?
 

Watch MrExcel Video

Forum statistics

Threads
1,122,214
Messages
5,594,882
Members
413,947
Latest member
gizmolucy

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