Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    41

    Unanswered: Too few parameters error

    Good day,

    I am getting an "Too few parameters error:Expected 1" on the indicated line below:

    Dim db As Database
    Dim rs1 As Recordset
    Dim rs2 As Recordset
    Dim rs3 As Recordset

    Dim strsql1 As String
    Dim strsql2 As String
    Dim strsql3 As String

    Dim intExistV As Integer, intExistF As Integer, intTBAvail As Integer, dblForeAb As Double, intTrueAvail As Integer, dblThresh As Double

    Set db = CurrentDb()

    strsql1 = "Select Count([empid]) as CountofEmpID from tblvacation where [tblvacation]![curtour] = " & Me.curtour
    strsql2 = "Select count([empid]) as CountofTourEmps from tblEmployee where tblEmployee.curtour = " & Me.curtour
    strsql3 = "Select Count([empid]) as CountofEmpIDF from tblfloater where tblfloater.curtour = " & Me.curtour


    Set rs1 = db.OpenRecordset(strsql1) <--Error on this line
    Set rs2 = db.OpenRecordset(strsql2)
    Set rs3 = db.OpenRecordset(strsql3)

    Just wondering if anyone my know what is causing this?
    I know the syntax is correct and the remaining parameters are optional.

    Thanks

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465

    Re: Too few parameters error

    Originally posted by justlearning200
    Good day,

    I am getting an "Too few parameters error:Expected 1" on the indicated line below:

    Dim db As Database
    Dim rs1 As Recordset
    Dim rs2 As Recordset
    Dim rs3 As Recordset

    Dim strsql1 As String
    Dim strsql2 As String
    Dim strsql3 As String

    Dim intExistV As Integer, intExistF As Integer, intTBAvail As Integer, dblForeAb As Double, intTrueAvail As Integer, dblThresh As Double

    Set db = CurrentDb()

    strsql1 = "Select Count([empid]) as CountofEmpID from tblvacation where [tblvacation]![curtour] = " & Me.curtour
    strsql2 = "Select count([empid]) as CountofTourEmps from tblEmployee where tblEmployee.curtour = " & Me.curtour
    strsql3 = "Select Count([empid]) as CountofEmpIDF from tblfloater where tblfloater.curtour = " & Me.curtour


    Set rs1 = db.OpenRecordset(strsql1) <--Error on this line
    Set rs2 = db.OpenRecordset(strsql2)
    Set rs3 = db.OpenRecordset(strsql3)

    Just wondering if anyone my know what is causing this?
    I know the syntax is correct and the remaining parameters are optional.

    Thanks
    I thing that you have and error in this:
    where [tblvacation]![curtour] = " & Me.curtour
    must be
    where [tblvacation].[curtour] = " & Me.curtour
    or
    where tblvacation.curtour = " & Me.curtour
    Saludos
    Norberto

  3. #3
    Join Date
    Nov 2003
    Location
    San Francisco, CA USA
    Posts
    59

    Re: Too few parameters error

    There's nothing meaningful in that message from my experience.

    I have always seen it when there's an error or typo in my SQL syntax -- in spite of the fact that nothing about that message suggests this is the source of the problem.

    Magee

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •