Results 1 to 4 of 4
  1. #1
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287

    Button to clear a record, not working

    Hey guys,

    I have a form to "Un-Issue" tickets to a salesman. This form, when opened, copies all of the tickets for a selected salesperon that have "date rcvd = null" to a temporary table (T_CheckOut_Edit_Temp). Each record has a button "UnIssue" that has the code shown:


    Code:
    Private Sub Unissue_Click()    
        CurrentDb.Execute "UPDATE T_CheckOut_Edit_Temp SET DateIssued= Null, Type=Null, " _
            & "Salesperson=Null, SalesName=Null, Store=Null, Clerical=Null, DateRcvd=Null " _
            & "WHERE SerialNumber= Me.SerialNumber"
        Me.Requery
    End Sub
    It should set all of the fields to null, except serial number. All I am getting is "error 3061, Too few parameters. Expected 1." Here is a snipped of the form and the table that it is linked to:
    Click image for larger version. 

Name:	form.PNG 
Views:	11 
Size:	67.0 KB 
ID:	15413Click image for larger version. 

Name:	table.PNG 
Views:	11 
Size:	6.7 KB 
ID:	15414

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Have you tried:
    Code:
    Private Sub Unissue_Click()
            CurrentDb.Execute "UPDATE T_CheckOut_Edit_Temp SET DateIssued= Null, Type=Null, " _
            & "Salesperson=Null, SalesName=Null, Store=Null, Clerical=Null, DateRcvd=Null " _
            & "WHERE SerialNumber= " & Me.SerialNumber
        Me.Requery 
    End Sub
    Last edited by June7; 02-15-2014 at 11:55 PM.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Do not include variables within quotes - concatenate variables. Reference to form control as dynamic criteria is a variable. Bob's posting shows correction in the WHERE clause to concatenate variable.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Perfect. Thanks for the help guys!

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

Similar Threads

  1. clear fields button not working
    By fainterm in forum Forms
    Replies: 20
    Last Post: 02-04-2014, 01:13 PM
  2. Replies: 2
    Last Post: 08-03-2013, 03:41 PM
  3. Replies: 11
    Last Post: 06-05-2013, 08:15 AM
  4. How to create a clear button
    By tomneedshelp in forum Access
    Replies: 1
    Last Post: 05-10-2012, 05:21 AM
  5. Add Record Button isn't working
    By tmcrouse in forum Forms
    Replies: 6
    Last Post: 08-02-2010, 02:09 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
  •  
Other Forums: Microsoft Office Forums