I am getting a errror of mismatching type in a SQL.
My searchinf field is long interger (primary key) and I couldn't find how to
pass it as numeric variable to the SQL statement. It is assuming always
assuming it as text.
I tried already the following, statements w/o sucess:
notes: getID is a long variable (which store the value of a control in a
form - (see next)
ShowIDtoChange is a control in a form
Statments tried:
Set rst = dbs.OpenRecordset("SELECT T_ListToReclass.IDCOP FROM
T_ListToReclass WHERE
(((T_ListToReclass.IDCOP)=[Forms]![F_Main]![ShowIDtoChange]));
'Set rst = dbs.OpenRecordset("SELECT T_ListToReclass.IDCOP FROM
T_ListToReclass WHERE
(((T_ListToReclass.IDCOP)=[Forms]![F_Main]![ShowIDtoChange]));")
'Set rst = dbs.OpenRecordset("select * from T_ListToReclass Where IDCOP='" +
getID + "'", dbOpenDynaset)
'Set rst = dbs.OpenRecordset("select * from T_ListToReclass Where
IDCOP=getID", dbOpenDynaset)
Thanks in advance for your help.
Thanks
Nikos Yannacopoulos - 24 Feb 2005 14:30 GMT
Jack,
Try something like:
strSQL = "SELECT T_ListToReclass.IDCOP FROM T_ListToReclass"
strSQL = strSQL & " WHERE T_ListToReclass.IDCOP)="
strSQL = strSQL & [Forms]![F_Main]![ShowIDtoChange]
Set rst = dbs.OpenRecordset(strSQL)
HTH,
Nikos
> I am getting a errror of mismatching type in a SQL.
> My searchinf field is long interger (primary key) and I couldn't find how to
[quoted text clipped - 25 lines]
> Thanks in advance for your help.
> Thanks
Lippi - 25 Feb 2005 00:28 GMT
Jack is a good friend and introduced me to this new group and proposed the
question in my behaft. Now I am a user also!!
Thanks Niko - your tip works perfectly.
See you around...(:
Lippi
> I am getting a errror of mismatching type in a SQL.
> My searchinf field is long interger (primary key) and I couldn't find how to
[quoted text clipped - 25 lines]
> Thanks in advance for your help.
> Thanks
Nikos Yannacopoulos - 25 Feb 2005 08:26 GMT
Lippi,
Glad it worked. Welcome to the NG's, I'm sure we'll hear more of you.
Regards,
Nikos
> Jack is a good friend and introduced me to this new group and proposed the
> question in my behaft. Now I am a user also!!
[quoted text clipped - 31 lines]
>>Thanks in advance for your help.
>>Thanks