Results 1 to 10 of 10
  1. #1
    aty01 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    5

    Urgent Access query help required

    hi

    i have a issue with my database

    i have a customer, orders, stock tables

    i have customers placing orders

    however the stock doesn't update. to get around this i created an update query, so that the stock will automatically update as i process orders.

    however the problem that i have is that once i run the update query it apply to all of the orders again

    e.g.

    item 1 - qty in stock 100

    item 2 - qty in stock 100

    if i place a order for item 1 and i require #50 item 1's.

    and i run the update query, it will work fine

    but if i place a order for item 2 (#50 qty) it will take off 50 for item 2 but it will also apply the query to item 1 again leaving no item 1 left

    please help

    many thanks



    Aty01

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Sounds like a problem with the criteria used in the query.
    Can you show us the SQL of the query.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    aty01 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    5
    hi bob

    i didnt use sql but what i put in the update column was

    [stock]![qty in stock] - [orderline]![quantity]

    qty in stock - qty ordered

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    So have you set any criteria for the update. If not, then all records in the table will be updated.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    aty01 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    5
    hi bob

    what do i put in the criteria

    am not sure

    please help


    Cheers

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Take a look at this link:
    http://office.microsoft.com/en-us/ac...010076527.aspx
    Post back if you need more help.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    aty01 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    5
    hi bob

    i do realise that i am supposed to put something into the criteria box,

    but am not sure wht to put in there.

    all i want is to apply the update to the last order placed

  8. #8
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    What are the names of the fields in your stock table
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  9. #9
    aty01 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    5
    stock id
    supplier id FK
    stock name
    price
    qty in stock


    the fields that i`m trying to query are qty in stock & quantity ordered

    qty in stock - quantity ordered

    but i need to put something in the criteria part

  10. #10
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    I think that will be something like:
    "[stock id] = Something that matches"
    This is often a number.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Tabbed Form - Urgent tips required!
    By kp123 in forum Forms
    Replies: 1
    Last Post: 11-24-2011, 10:11 AM
  2. Query help urgent
    By IKNOWNOSQL in forum Queries
    Replies: 1
    Last Post: 06-29-2011, 05:15 AM
  3. Urgent Query Help Please
    By AccessFreak in forum Queries
    Replies: 1
    Last Post: 06-23-2011, 06:02 AM
  4. Help!!! Urgent Access SQL Query Question
    By pinecrest515 in forum Queries
    Replies: 1
    Last Post: 12-06-2010, 02:40 PM
  5. Query to run from a FORM VERY URGENT
    By prag in forum Forms
    Replies: 14
    Last Post: 10-08-2009, 01:51 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