M
Monty
I have an SQL statement that returns a 'data type mismatch' in the
criteria of a DoCmd.RunSQL statement:
DoCmd.RunSQL ("DELETE FROM Hardware WHERE Hardware.[record key] = ' "
Forms![Hardware Form]![hardware list].Column(0) " ' ")
(I've included spaces in the single and double quotes for clarity in
this post)
[record key] has an AutoNumber property setting, and [hardware list]
list is a combo box that has an SQL select statement as it's control
source. Column(0) is the value of [record key] from the Hardware
table.
I presume the error messages refers to the data type returned in the
WHERE clause. If I'm correct in that assumption, what data type should
it be? Looking at the Hardware table [record key] properties I see
it's a Long Integer, but my attempts to do a temporary data type
conversion with CLng result in the same error.
What am I missing? Hope there's enough information here.
Dale
criteria of a DoCmd.RunSQL statement:
DoCmd.RunSQL ("DELETE FROM Hardware WHERE Hardware.[record key] = ' "
Forms![Hardware Form]![hardware list].Column(0) " ' ")
(I've included spaces in the single and double quotes for clarity in
this post)
[record key] has an AutoNumber property setting, and [hardware list]
list is a combo box that has an SQL select statement as it's control
source. Column(0) is the value of [record key] from the Hardware
table.
I presume the error messages refers to the data type returned in the
WHERE clause. If I'm correct in that assumption, what data type should
it be? Looking at the Hardware table [record key] properties I see
it's a Long Integer, but my attempts to do a temporary data type
conversion with CLng result in the same error.
What am I missing? Hope there's enough information here.
Dale