Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2004
    Location
    California
    Posts
    502

    Unanswered: Error 3061: To few parameters. Expected 1

    Rudy helped me with this one but somehow I'm getting this error on the first occourance of "CurrentDb.Execute strSQL" which is highlighted in a yellow background.

    I can't figure out which parameter is missing?

    Code:
    Private Sub Command0_Click()
    Dim strSQL As String
    strSQL = "UPDATE TblSoCalMLS_Download INNER JOIN TblSoCalMLS_Normalize ON TblSoCalMLS_Download.OfficeID = TblSoCalMLS_Normalize.UID Set tblSoCalMLS_Download.P_OfficeName = [tblSoCalMLS_Normalize].[officename]"
    CurrentDb.Execute strSQL     (This line highlighted in yellow)
    strSQL = "UPDATE TblSoCalMLS_Download INNER JOIN TblSoCalMLS_Normalize ON TblSoCalMLS_Download.OfficeSell = TblSoCalMLS_Normalize.UID Set TblSoCalMLS_Download.P_OfficeNameSell = [tblSoCalMLS_Normalize].[officename]"
    CurrentDb.Execute strSQL
    End Sub
    Any ideas. . ? Rick

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    The problem is in your SQL. You probably are including a column that doesn't exist or there is a typo in a column name.

    The easiest thing to do is to use the Immediate window to get the value of strSQL, then open a new query, paste the SQL then look at it in Design view. You will get a much better error message.

  3. #3
    Join Date
    Mar 2004
    Location
    California
    Posts
    502

    Too Many records . . .

    My table has over 400,000 records so I think that maybe I overloaded my system with the query. I'm not sure, however it is working now.

    I just don't know what happened.

    Thanks . . . Rick

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    If Err.Number = 3061 Then
    Msgbox "I can't believe this has happened again - contact Rick"
    End If

    George
    Home | Blog

  5. #5
    Join Date
    Apr 2007
    Posts
    4
    I am having the same problem with my query. This is in Crystal Reports mind you, but should be the same?? In Access if I sub the {?Territory} for [Enter Territory:] and so on, it works fine....hrmmm...

    SELECT Contract.Sale, Contract.datecreated, [Territory].[Territory]
    FROM Contract INNER JOIN Territory ON [Contract].[territory]=[Territory].[Town]
    WHERE Contract.datecreated BETWEEN #12/2/2006# AND {?WeekEndDate} AND Territory.Territory = {?Territory} AND (([Contract].[status])<>'Void');

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    First thing I'd suggest, is take out your RTP's {?_} and stick static values. Does this return any results? At a glance I'm guessing that your {?WeekEndDate} is causing the issue.
    George
    Home | Blog

  7. #7
    Join Date
    Apr 2007
    Posts
    4
    I tried taking out the {?WeekEndDate} and put the value in, nothing changed...I tried with just the {?WeekEndDate} and no {?Territory} still same error. The only time it worked is when I put in the values directly. Territory = "town";

    Any idea's?

  8. #8
    Join Date
    Apr 2007
    Posts
    4
    Could it be with the Date format?

  9. #9
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I was just coming back to suggest that.
    It may be the date format or...
    Code:
    BETWEEN #12/2/2006# AND {?WeekEndDate}
    It might be that SQL is not recognising the data returned as a date. Why have you used those hashes around the first date?
    George
    Home | Blog

  10. #10
    Join Date
    Apr 2007
    Posts
    4
    Force of habbit with MS ACCESS...this is totally stumping me...

    It isnt the date format at all...

  11. #11
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Have you tried:
    Code:
    BETWEEN #12/2/2006# AND '#' & {?WeekEndDate} & '#'
    George
    Home | Blog

Posting Permissions

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