Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2013

    Question Unanswered: how to update a mainform into a subform

    Hey there anyone would yous be so kind to help me because im troubleshooting this error now for a week found no luck

    after I edit information and change the information and click update it gives me a error i tried the parenthesis brackets no luck

    Error im getting( Too few parameters Expected 1. Run time error '3061')

    Heres my code I think theres a bug in my code:

    Private Sub cmdUpdate_Click()
    Dim strSql As String
    strSql = "UPDATE PlantTransaction " & _
    "SET TransactionID=" & Me.txtTranID & _
    ",[Plant Number]='" & Me.txtPlantNo & "'" & _
    ",TransactionDate=#" & Me.txtTransDate & "#" & _
    ",Opening_Hours='" & Me.txtOpeningHRS & "'" & _
    ",Closing_Hours='" & Me.CloseHrs & "'" & _
    ",Fuel='" & Me.txtFuel & "'" & _
    ",[Fuel Cons Fuel/Hours]='" & Me.txtFuelConsFuelHr & "'" & _
    ",[Hour Meter Replaced]='" & Me.txtHrMtrRep & "'" & _
    ",Comments='" & Me.txtComments & "'" & _
    ",[Take on Hour]='" & Me.txtTOH & "'" & _
    " WHERE TransactionID=" & Me.PlantTransactionQuery.Form.Recordset.Fields("Tr ansactionID")
    Debug.Print strSql ' <- prints to Immediate window
    CurrentDb.Execute strSql, dbFailOnError
    End Sub

    Any help will be very much appreciated Thanks in advance!!!
    Last edited by grampo; 05-26-13 at 16:49.

  2. #2
    Join Date
    Feb 2012
    "Too few parameters Expected 1" means you have 1 field name in the query which isn't the same as in the database.

  3. #3
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    Your syntax is treating [Plant Number], Opening_Hours, Closing_Hours and [Fuel Cons Fuel/Hours] as if they are all defined as Text Fields; is this correct?

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Apr 2013
    I'm having difficulties with this database its my first project just started doing access two months ago certain stuff is not making sense will you be so kind to please help me because I need to go present my database on Wednesday this data is highly confidentail can't I forward you my database via email for you to have a look at it because I'm troubleshooting the edit and update new and save which must save a duplicate now for a new record it will make more sense if I can forward you my database basically everything is working but there's just few bugs and tweeks in my code I need to do which I can't come accross but I never quit because IT is my life I will really appreciated Missinglinq and reaanb,my email adress is Thanks in advance!!!
    Last edited by grampo; 05-28-13 at 06:40.

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