Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Update/lookup value of one field based upon entry in previous field

Discussion in 'Information Technology' started by stevewrite@gmail.com, Jul 28, 2006.

  1. stevewrite@gmail.com

    stevewrite@gmail.com
    Expand Collapse
    Guest

    This UPDATE query works fine, after the fact:

    UPDATE authorizations, consumers SET authorizations.fname =
    consumers.fname
    WHERE authorizations.bsu_no=consumers.bsu_no;

    When I enter bsu_no in rows and then close the table and run the UPDATE
    query, it's perfect.

    What I want is for the update to occur after entering the bsu_no in the
    table and dropping focus on the field.

    I know the answer's simple, but it's Friday afternoon and my brain is
    fried, so any help is greatly appreciated.

    Thanks,

    Steve
     
  2. Loading...

    Similar Threads Forum Date
    Sikh Values Blogs Oct 21, 2015
    Jainism Jainism and Sikhism: The Value of Being “Footnote” Traditions Interfaith Dialogues Jul 13, 2015
    World Why do we value gold? Breaking News Dec 9, 2013
    Canada Quebec's Charter of Values: If You Have A Personal Story, Please Share It Here! Breaking News Sep 19, 2013
    Canada Thousands March through Montreal to Protest Quebec Charter of Values (& Video) Breaking News Sep 16, 2013

  3. Pat Hartman\(MVP\)

    Pat Hartman\(MVP\)
    Expand Collapse
    Guest

    1. Your query syntax is incorrect because the join type is not specified.
    Open the QBE and draw the appropriate join line between the two tables.
    2. Tables do not expose events so there is no place to put the code to run
    the update query.
    3. And last but not least, you shouldn't be doing this in the first place.
    It is not necessary to duplicate data. Data should be stored in one and
    only one place. When you need data from a related table, create a query
    that joins the necessary tables.

    <stevewrite@gmail.com> wrote in message
    news:1149880693.297062.64330@h76g2000cwa.googlegroups.com...
    > This UPDATE query works fine, after the fact:
    >
    > UPDATE authorizations, consumers SET authorizations.fname =
    > consumers.fname
    > WHERE authorizations.bsu_no=consumers.bsu_no;
    >
    > When I enter bsu_no in rows and then close the table and run the UPDATE
    > query, it's perfect.
    >
    > What I want is for the update to occur after entering the bsu_no in the
    > table and dropping focus on the field.
    >
    > I know the answer's simple, but it's Friday afternoon and my brain is
    > fried, so any help is greatly appreciated.
    >
    > Thanks,
    >
    > Steve
    >
     
  4. stevewrite@gmail.com

    stevewrite@gmail.com
    Expand Collapse
    Guest

    1. OK, I did that in the QBE (I wish I could just do this in SQL and
    avoid Access altogether!). The tables were already joined in a
    previously-defined relationship, so I didn't think it'd be necessary,
    here.

    2. O-kay......

    3. "Now we see the corruption inherent in the system!" (points for
    reference ;)) I blame Friday. I'm thinking I need to store the names
    in the "authorizations" database so I can report on them later but, of
    course, all I need is the bsu_no field stored in the main database and
    my later reports can lookup and retrieve the names as needed.

    So, I'll end up with a main database, a couple of reference databases,
    a date-entry form that requires the bsu_no field but simply retrieves
    and displays the names; and later reports that also key off the bsu_no
    field and only retrieve the names!

    Paradigm block removed, now I can enjoy the weekend, thanks Pat!


    Pat Hartman(MVP) wrote:
    > 1. Your query syntax is incorrect because the join type is not specified.
    > Open the QBE and draw the appropriate join line between the two tables.
    > 2. Tables do not expose events so there is no place to put the code to run
    > the update query.
    > 3. And last but not least, you shouldn't be doing this in the first place.
    > It is not necessary to duplicate data. Data should be stored in one and
    > only one place. When you need data from a related table, create a query
    > that joins the necessary tables.
    >
    > <stevewrite@gmail.com> wrote in message
    > news:1149880693.297062.64330@h76g2000cwa.googlegroups.com...
    > > This UPDATE query works fine, after the fact:
    > >
    > > UPDATE authorizations, consumers SET authorizations.fname =
    > > consumers.fname
    > > WHERE authorizations.bsu_no=consumers.bsu_no;
    > >
    > > When I enter bsu_no in rows and then close the table and run the UPDATE
    > > query, it's perfect.
    > >
    > > What I want is for the update to occur after entering the bsu_no in the
    > > table and dropping focus on the field.
    > >
    > > I know the answer's simple, but it's Friday afternoon and my brain is
    > > fried, so any help is greatly appreciated.
    > >
    > > Thanks,
    > >
    > > Steve
    > >
     

Share This Page