By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,436 Members | 2,994 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,436 IT Pros & Developers. It's quick & easy.

error msg like 'runtime error 13' & type mismatch

P: 1
hi all

i created two textboxes to insert date and a button..i hv this following code for that button..but when i ran error msg shows error like 'runtime error 13' & type mismatch..i hv no idea why it happens as long as i hv only simple code

dbEnq.RecordSource = " select * from Enquirer where Date > '" & Format("MM/dd/yyyy", txtDate1.Text) & "'" And " Date < '" &
Format("MM/dd/yyyy", txtDate2.Text) & "'"
bEnq.RecordSource = " select * from Enquirer where LibDuty = '" & txtDate1.Text & "'"
dbEnq.Refresh
Sep 24 '07 #1
Share this Question
Share on Google+
2 Replies


hariharanmca
100+
P: 1,977
Run time error 13 type mismatch is only because of
In db.openrecordset("Tablename") may be you are using some where condition in
which there may be syntex error means maybe you are using single quotes for an
integer type of field.(this will give the above error if you are back end is
access)
Sep 24 '07 #2

QVeen72
Expert 100+
P: 1,445
Hi,

In SQL Statement, Wrap the Date with "#" :

dbEnq.RecordSource = " select * from Enquirer where Date > #" & Format("MM/dd/yyyy", txtDate1.Text) & "# And Date < #" &
Format("MM/dd/yyyy", txtDate2.Text) & "#"

Dont Reserved Words as Field Names .
Rename Date Field with some EDate or so..

Regards
Veena
Sep 24 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.