Search results

  1. J

    SQL update in VBA public sub Error 91

    Runtime Error 91, is the error I get. This is the base code I have written to open a recordset: **Begin base code** Strsql = "SELECT bomts.*, Rotors.PartNumber, Rotors.Price, Rotors.Price2 FROM BOMTS LEFT JOIN Rotors ON BOMTS.Component = Rotors.PartNumber WHERE(isnull(BOMTS.[Level])) OR...
  2. J

    SQL in an Access module public sub

    I would like to create an SQL statement in one public sub, to be called from another public sub, all of this in an Access module. I have 40,000 records in table "A" and approximately 2,500 of those records have a wrong value in one of the fields of its record. In table "B", the correct value...
  3. J

    Solved MS Access SQL too few parameters 3061 "2"

    Sorry Shanemac51, I am new to code. Do you have a solution for me? I am at a dead end
  4. J

    Solved MS Access SQL too few parameters 3061 "2"

    Thank you for the help, but I still have errors, albeit new errors. When I loaded the SQL into the Access query builder it asked for parameters to be loaded for the fields I list for the join, in bold: Set rstsrc = db.OpenRecordset("SELECT * FROM ES003CBP left outer join es003ein on...
  5. J

    Solved MS Access SQL too few parameters 3061 "2"

    Apologies. I am new to this. I cannot get past the error so I can use debug.print. If you tell me what I need to do to show how the SQL string resolves, I will do that. No way do I want this to be PITA for anyone. I am desperate.
  6. J

    Solved MS Access SQL too few parameters 3061 "2"

    Thank you. I am using SQL (see code), I triple checked spelling. I have four hours of debug time on this and need help please.
  7. J

    Solved MS Access SQL too few parameters 3061 "2"

    This is my code below at the bottom of this post; 4 hours of headbanging and I cannot figure it out. I have one source table and one target table. Three fields in the sub query are to be used to filter the resulting recordset. The source table contains some records already in the target table...
  8. J

    Duplicate records, how to process

    I have records in a file. New records need to be added and I do this with an update. What is the best way to process a set of new records to be added (10,000) and not process records that already exist in the target table? With an SQL does not exist? Looking for best way to do this and not...
  9. J

    Solved SQL keeps failing on select

    Code suggestions worked. Now I get Error 2342 A runsql action requires an argument consisting of an sql statement. This is a select SQL that has been called from a public sub. In this first public sub I have created two variables and I am passing field values into those variables to use in...
  10. J

    Solved SQL keeps failing on select

    I have the following code. Just before the update statement below I call a public sub. I want to pass two work variables to this new public sub. One is text the other numeric. When I can get the SQL to work I then want to populate the item field in ![partnumber], the third field below form...
Top Bottom