Hello Sandra,
I get the same thing.
CurrentDb.Execute "Parameters [FindSpecTemplate] Long;" & _
"Delete [RuleHt Specs Template B].[rhSpecID]" & _
"FROM [RuleHt Specs Template B]" & _
"WHERE [RuleHt Specs Template B].[rhSpecID]= " &
Me.FindSpecTemplate & ";"
I also tried,
= " & Me.[FindSpecTemplate] & ";"
and
= " & Me![FindSpecTemplate] & ";"
and
and other various syntaxes, but with the same result.
I accidently did:
"WHERE [RuleHt Specs Template B].[rhSpecID]= ]" &
Me.FindSpecTemplate & ";"
Notice the left ] (bracket) after the = sign...
That gave me a syntax error:
Syntax error in query expression '[RuleHt Specs Template B].[rhSpecID]= ]10"
10 being the value in the combo. The combo is unbound but the column it is
pointing to is a long int.
This is Access XP in a A2000 Database.? I wonder if that could be a
problem? The other day I did a DLookup and Appended the value of a
Textbox, which didn't work. So I hardcoded it as above and it did work.
God Bless,
Mark
Sandra Daigle said:
Intead of declaring a parameter you need to append in the value of the
combo - the way you have it the name of the combo is hardcoded into the
string. I am assuming that rhSpecID is a numeric field, in which case the
following should work:
CurrentDb.Execute "Delete [RuleHt Specs Template B].[rhSpecID]" & _
"FROM [RuleHt Specs Template B]" & _
"WHERE [RuleHt Specs Template B].[rhSpecID]=" &
me.FindSpecTemplate
&
";"
--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
What am I dong wrong? I want a Combo box, [FindSpecTemplate] to be
the parameter for the query. I get error "Too few parameters.
Expected 1"
CurrentDb.Execute "Parameters [FindSpecTemplate] Long;" & _
"Delete [RuleHt Specs Template B].[rhSpecID]" & _
"FROM [RuleHt Specs Template B]" & _
"WHERE [RuleHt Specs Template
B].[rhSpecID]=[FindSpecTemplate];"
Thanks for the help and God Bless,
Mark A. Sam