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

Data type mismatch....

P: n/a
Mo
The following select statement is givign me a 'data type mismatch' message
and I don't really know why.

strSQL = "SELECT CN"
strSQL = strSQL & " FROM tblDeaths"
strSQL = strSQL & " WHERE CN = " & Forms!frm_search!list_main.Column(0) &
""

CN is an integer data type in 'tblDeaths'. Does the error have something to
do with the fact that I'm trying to pick up the CN from a list box? If so
what do I do about it. Thanks very much for any help.

Mo
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Mo" <m.********@nospam.qmul.ac.uk> wrote in message news:<cf**********@beta.qmul.ac.uk>...
The following select statement is givign me a 'data type mismatch' message
and I don't really know why.

strSQL = "SELECT CN"
strSQL = strSQL & " FROM tblDeaths"
strSQL = strSQL & " WHERE CN = " & Forms!frm_search!list_main.Column(0) &
""

CN is an integer data type in 'tblDeaths'. Does the error have something to
do with the fact that I'm trying to pick up the CN from a list box? If so
what do I do about it. Thanks very much for any help.

Mo


If you're using a listbox, you have to iterate through the
ItemsSelected collection. If you're going to do that, there's code
here...

http://www.mvps.org/access/forms/frm0007.htm

Otherwise, if you can only choose ONE value from the list, use a
combobox instead.

Oh, James Fortune posted an improved version of this in the last few
days (maybe a week...) read that.
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.