Inserting a value from an Access form into a SQL pass through query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lewe22
    New Member
    • Sep 2007
    • 94

    Inserting a value from an Access form into a SQL pass through query

    I am creating a small Access db which performs a series of updates to a SQL db.

    The Access db consists of a ‘Main Form’, from which the user can run each update via a series of command buttons.

    Each update has been written as a SQL pass-through query.

    Example Update:

    UPDATE unit_instance_o ccurrences uio
    SET fes_active_plac es =
    (SELECT COUNT(*) FROM registration_un its ru
    WHERE ru.fes_unit_ins tance_code = uio.fes_uins_in stance_code
    AND ru.uio_occurren ce_code = uio.calocc_occu rrence_code
    AND ru.progress_sta tus = 'A'
    AND ru.uio_occurren ce_code = 07);

    Each query is dependant on a year (07) however I want the user to determine the year from a combo box on the ‘Main Form’.

    How do I best go about this? If necessary I can rewrite the pass-through update queries as pure Access-update queries.

    Have not been having much success as my VB knowledge is limited. Any help would be much appreciated. Many thanks.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Are you trying to update both the databases in parallel ?

    Comment

    • Lewe22
      New Member
      • Sep 2007
      • 94

      #3
      Originally posted by debasisdas
      Are you trying to update both the databases in parallel ?
      The objective is to update a table in the SQL database.

      The key thing is that i want to be able to run my pass through query from a button on a form. Before clicking the button the user must select the year. I want to be able to insert that year into the body of the PTQ.

      It is just so i can set everything up and the user can then define the year when running the query.

      Comment

      Working...