Results 1 to 2 of 2

Too Few Parameters. Expected 1

  1. #1
    flamesofdoom is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    1

    Too Few Parameters. Expected 1

    • I am receiving the run-time error of '3061' Too Few parameters expected 1.

      Here is the code i have up to the point of the error.

      Private Sub cmdShowLots_Click()
      Dim intX As Integer
      intX = DCount("fldOwnerID", "tblLots", "fldCustomerID ='" & Me.fldCustomerID & "'")
      If intX = 0 Then
      MsgBox "This customer does not own a lot."
      Else
      Dim strGetLots As String
      strGetLots = ("Select * from tblLots Where fldCustomerID = " & Me.fldCustomerID)
      Dim Db As Database


      Set Db = CurrentDb
      Dim rsLots As DAO.Recordset
      Set rsLots = Db.OpenRecordset(strGetLots)

      Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    20,624
    If the DCount works, your field is text and needs the same delimiters when opening a recordset.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. too few parameters; expected 2
    By slimjen in forum Forms
    Replies: 13
    Last Post: 07-26-2012, 02:42 PM
  2. Too few parameters. expected 1.
    By seth1685 in forum Programming
    Replies: 1
    Last Post: 01-11-2012, 08:08 AM
  3. Too few parameters expected 4
    By forestgump in forum Programming
    Replies: 1
    Last Post: 04-15-2011, 09:10 AM
  4. Too few parameters. Expected 2.
    By PPCMIS2009 in forum Access
    Replies: 0
    Last Post: 01-28-2009, 01:02 PM

Posting Permissions

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