Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

too few parameters

Status
Not open for further replies.

matrixknow

IS-IT--Management
May 3, 2007
78
Hola,

I have a sql to feed my recordset. I need a parameter from a form. If I type the value literal eg 83 it works. The reference to the formfield works also.
When I try to include the variable or the form reference in my WHERE clausule he said to few parameters. I thinks its a syntax trouble ?
Code:
Dim iID_CCT As Integer
iID_CCT = Forms![F_01_AR_FICHE]![F_02_AR_FICHE_CCT]![ID_CCT]

& "WHERE T_02_CONTACT.ID_CCT =  iID_CCT " _
 
& "WHERE T_02_CONTACT.ID_CCT = " & iID_CCT _

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Code:
 & "WHERE T_02_CONTACT.ID_CCT = " & iID_CCT & " " _
         & "ORDER BY T_02_CONTACT.CCTFORNAME;"

thanks ! I don't see clear but you have to close also the var iID_CCT & " " _
 
or add a space at the beginning of the next line:
Code:
& "WHERE T_02_CONTACT.ID_CCT = " & iID_CCT _
         & "[COLOR=white yellow] [/color]ORDER BY T_02_CONTACT.CCTFORNAME;"

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for database developers:
The Fundamentals of Relational Database Design
Understanding SQL Joins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top