access vba createqry error 13 mismatch

RCBricker

Well-known Member
Joined
Feb 4, 2003
Messages
1,560
I am just not seeing this error.

my code is:

Code:
                Set qdf = dbF.CreateQueryDef(strQRYN, strSQLQRY)
                Application.RefreshDatabaseWindow

my two variable strings are:

strSQLQRY=
SELECT * FROM [tbl_ERP_JSTO_DAI_CBPD_DAI_TB 2015] WHERE (([tbl_ERP_JSTO_DAI_CBPD_DAI_TB 2015].[DB FYMonth] = '1'));

strQRYN=
qry 2015 October DAI GL to TB Data Validation

any ideas why this is not working?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
if I wrap the create query in a resume next error handling. the code continues and the query is created. I am confused!
 
Upvote 0
It works for me. The mismatch might be a problem in the actual sql query you created (for instance, the month data might be numeric, not string data).
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,814
Messages
6,162,132
Members
451,743
Latest member
matt3388

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