Results 1 to 4 of 4
  1. #1
    Techno is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2023
    Posts
    31

    Too few parameters. Expected 1. Error

    Through a login form, I am trying to update a comments table.
    A button should update the comments table by picking the values typed in the text box 25 by the user and append into the comments table.

    SQL = "INSERT INTO tblComments ( [DateOfEntry], [Names], [Comments] ) VALUES ( Now(), '" & Environ("USERNAME") & "', " & Me!Text25.Value & " )"


    CurrentDb.Execute SQL

    This code on the button press is giving Run time error 3601, Too few parameters. Expected 1.

    This code was originally working on different column names and different data types, I have changed it to my needs.

    Any help greatly appreciated.

  2. #2
    Techno is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2023
    Posts
    31
    It worked by changing as below...
    SQL = "INSERT INTO tblComments ( [DateOfEntry], [Names], [Comments] ) VALUES ( Now(), '" & Environ("USERNAME") & "', '" & Me!Text25.Value & "' )"

    Thank you.

  3. #3
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    You could also use

    SQL = "INSERT INTO tblComments ( [DateOfEntry], [Names], [Comments] ) VALUES (#" & Now() & "#,""" & Environ("USERNAME") & """,""" & Me!Text25.Value & """ )"
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  4. #4
    Techno is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2023
    Posts
    31
    Thank you...

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

Similar Threads

  1. Replies: 9
    Last Post: 05-29-2023, 01:04 AM
  2. Replies: 3
    Last Post: 03-01-2018, 01:37 PM
  3. error 3601 too few parameters, expected 1
    By JeroenMioch in forum Programming
    Replies: 6
    Last Post: 03-22-2016, 02:28 AM
  4. Error 3061. Too few parameters. Expected 1.
    By Glenn_Suggs in forum Programming
    Replies: 5
    Last Post: 02-03-2015, 12:03 PM
  5. Error on too few parameters expected 3
    By haishuoBB in forum Programming
    Replies: 7
    Last Post: 02-27-2013, 03:26 PM

Tags for this Thread

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