Results 1 to 2 of 2
  1. #1
    Rickochezz is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    45

    Run-Time Error '3061: Too few parameters. Expected 2.

    Set rs1 = CurrentDb.OpenRecordset(SQL, dbOpenSnapshot)

    The above line is highlighted with the error



    SQL = "SELECT Exam.StudentID, Student.LastName, Student.FirstNames, Exam.ExamDate, Exam.ExamTime, StudentCourse.CourseStatus, StudentCourse.SerialID, " & _
    "StudentCourse.PrintCertificate, Exam.InstructorID, Student.[Prov Exam Language], IIf(Nz([Prov Exam Language])=1,'','French') AS [Language] " & _
    "FROM Student INNER JOIN (StudentCourse INNER JOIN Exam ON StudentCourse.StudentCourseID = Exam.StudentCourseID) ON Student.StudentID = Exam.StudentID " & _
    "WHERE (((Exam.ExamTime) = [Forms]![frmExamSerial]![cboTime]) And ((StudentCourse.CourseStatus) = 'Registered' Or (StudentCourse.CourseStatus) = 'In Progress' " & _
    "Or (StudentCourse.CourseStatus) = 'Completed') And ((StudentCourse.SerialID) = [Forms]![frmExamSerial]![cboSerial])) ORDER BY Student.LastName, Student.FirstNames;"

    The SQL statement is copied from the SQL statement of a query.

    What needs to be repaired in the SQL statement?

    Thanks in advance

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You need to change the reference to the form fields to be outside the SQL: e.g. ((StudentCourse.SerialID) = " & [Forms]![frmExamSerial]![cboSerial])) & " (not sure what your data types are)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 09-28-2016, 07:13 AM
  2. Replies: 5
    Last Post: 03-27-2015, 03:42 PM
  3. Error 3061. Too few parameters. Expected 1.
    By Glenn_Suggs in forum Programming
    Replies: 5
    Last Post: 02-03-2015, 12:03 PM
  4. 3061 Error. Too few parameters. Expected 1.
    By rghollenbeck in forum Queries
    Replies: 5
    Last Post: 09-28-2011, 12:12 PM
  5. Replies: 1
    Last Post: 05-21-2011, 01:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums