Results 1 to 2 of 2
  1. #1
    jasdem is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    27

    Too few Parameters Error

    I am trying to run this query in the back end. The information that is selected through this query is used to generate emails further on. When I go to generate the emails, I get the Run-time error 3601



    Code:
     strQuery_Appointment = "SELECT TableALOA.CFN, TableLocation_ALOA.Location, TableLocation_ALOA.Date_Location, TableLocation_ALOA.FieldCaptain, TableLocation_ALOA.Address_1, TableLocation_ALOA.Address_2, TableLocation_ALOA.Room, TableALOA.Appointment, TableALOA.DBN " & _
                                "FROM TableLocation_ALOA INNER JOIN (TableALOA INNER JOIN TableSchools ON TableALOA.ID_Schools = TableSchools.ID) ON TableLocation_ALOA.ID = TableALOA.Location " & _
                                "WHERE (((TableALOA.CFN)='" & rcdNetwork!CFN & "') AND ((TableLocation_ALOA.Location)='" & rcdLocation!Location & "')) " & _
                                "ORDER BY TableALOA.Appointment, TableALOA.DBN;"
    
    
        Set rcdAppointment = CurrentDb.OpenRecordset(strQuery_Appointment, dbOpenDynaset)

    Set rcdAppointment is highlighted in the error message.

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Generally that's going to mean that rcdNetwork!CFN or rcdLocation!Location is NULL. In your case, however, you have them in quotes anyway in the SQL, so that's not it.

    I aliased the query to make it easier to read. The resulting code made me wonder if there is really a field TableLocation_ALOA.Location (TL.Location), or if your WHERE clause should actually read TableLocation_ALOA.Location (TA.Location)
    Code:
    strQuery_Appointment = "SELECT " & _ 
       "TA.CFN, TL.Location, TL.Date_Location, TL.FieldCaptain, " & _ 
       "TL.Address_1, TL.Address_2, TL.Room, TA.Appointment, TA.DBN " & _
       "FROM TableLocation_ALOA AS TL INNER JOIN " & _ 
          "(TableALOA AS TA INNER JOIN TableSchools AS TS" & _ 
          " ON TA.ID_Schools = TS.ID) " & _ 
       "ON TL.ID = TA.Location " & _
       "WHERE (((TA.CFN)='" & rcdNetwork!CFN & "') " & _ 
       "AND ((TL.Location)='" & rcdLocation!Location & "')) " & _
                                "ORDER BY TA.Appointment, TA.DBN;"

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

Similar Threads

  1. Error on too few parameters expected 3
    By haishuoBB in forum Programming
    Replies: 7
    Last Post: 02-27-2013, 03:26 PM
  2. Error 3061 Too Few parameters
    By gopherking in forum Programming
    Replies: 5
    Last Post: 10-06-2011, 11:50 AM
  3. Replies: 3
    Last Post: 07-23-2011, 08:34 AM
  4. Too few parameters error.
    By stupesek in forum Forms
    Replies: 5
    Last Post: 09-15-2010, 09:27 AM
  5. Why am I getting error: too few parameters?
    By cowboy in forum Programming
    Replies: 3
    Last Post: 03-24-2010, 10:13 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