Results 1 to 6 of 6
  1. #1
    darkwind is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2017
    Location
    Central U.S.
    Posts
    48

    CurrentProject.Connection.Execute Run-Time Error

    I'm having an issue where the code line to follow is giving me the error "Run-time error '-2147217904 (80040e10)': no value given for one or more required parameters." This line is intended to set the microscope # for all samples in a given project equal to the microscope number given for one of the samples. Here's the code line:

    Code:
    CurrentProject.Connection.Execute "UPDATE tblIAQSampleInfo SET Microscope=" & Me.Microscope & " WHERE ProjectID=" & Me.projectID
    There is a text box named, exactly, "Microscope" in the relevent form. tblIAQSampleInfo exists and has a field named, exactly, "Microscope". I've checked, double checked and triple checked these for typos and am confident there isn't one. So really pretty lost on why I would be getting this, especially considering these are the only differences from other similar lines of code, such as the below, which work perfectly.

    Code:
        CurrentProject.Connection.Execute "UPDATE tblIAQSampleInfo SET Analyst=" & Me.analyst & " WHERE ProjectID=" & Me.projectID




  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    is there a value in your microscope control on the form? if so - what is it?

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,522
    Docmd.RunSql "update table....."

    and if analyst is text,put quotes around it.

  4. #4
    darkwind is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2017
    Location
    Central U.S.
    Posts
    48
    Quote Originally Posted by Ajax View Post
    is there a value in your microscope control on the form? if so - what is it?
    It has the "Microscope" field from tblIAQSampleInfo as its control source. Its value is currently "PLM1".

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    since this is text you need to add single quotes

    ...SET Microscope='" & Me.Microscope & "' WHERE...

  6. #6
    darkwind is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2017
    Location
    Central U.S.
    Posts
    48
    Sorry for the late reply, was diverted to a different project for a couple days. Nice catch on that, thanks!

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

Similar Threads

  1. Replies: 4
    Last Post: 07-17-2014, 03:42 PM
  2. Replies: 0
    Last Post: 07-03-2014, 02:49 PM
  3. Replies: 3
    Last Post: 12-23-2010, 10:23 AM
  4. db.Execute Error 3061
    By JimG in forum Programming
    Replies: 5
    Last Post: 05-17-2010, 09:34 AM
  5. Replies: 2
    Last Post: 11-10-2009, 02:49 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