Results 1 to 5 of 5
  1. #1
    playtime38 is offline Novice
    Windows 10 Access 2007
    Join Date
    Dec 2015
    Posts
    7

    why query not update tables


    I am a newby and trying to get my head around relationship databases, and for this reason I have created 2 tables (it could quite easily have been one) to list all the items in my garage. First table is called tools table and is tools ID (auto), item, size and second table is called lokashin(for fear of using a reserved word) and consisits of tools ID auto, item,bay, box, bottle. I have created a query called tools query and it has the cols tools ID (auto) prim, one to one relationship with lokashin table tools ID (auto) prim, item, size, bay, with box and bottle hidden at this time because will only need those cols later in the listing. I show the query and fill out the data in datasheet view, and my question is why does it not update the tables from the query? This is a lot for anyone to understand and I can quite see that this type of data does not warrant a relationship and one table could easily have been done in xl, but the idea is to experiment with access and the tools listing is secondary. Am only using this as something that COULD be useful. I would have thought that inputting data to the query would update the table, because when I go in and out of the prog the data shows in the query? If i dont get an answer to this epistle I will take it that a query does not update a table and will have to think of some other data that would affect my surrounds. See for instance I have several pairs of pliers and thought that generic pliers could be in any of five locations. That was my idea. But a single table with 5 sets of pliers in different locations would just as easily be grouped into 5 with a search no pliers - only difference is that I would save myself inputting pliers for the other 4 times!! I reckon a one to one is no good and my setup is wrong if I want pliers to have 5 different locations. I am using access 2007 because I bought a disk for $297 a long time ago and want to use it. I am learning with Lynda.com but the movies dont tell me about this. I gave not seen anyone upload a file for people to run on this forum, nor do I think they would run it, because 2007 is old hat now,(although 2007.accdb would run on access 2016) and opening someone else file could bring viruses on to your computer. Whatsay about this?

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    suggest show your tables rather than writing about them - will be easier for others to understand. Also you should be using as form not entering data through queries

    From what you have described, your locashin table should have a locashinid autonumber and your tools ID would then be a long which you can relate back to the tools ID in your tools table

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Welcome to the forum.....

    Should not use spaces, punctuation or special characters (underscore is the exception) in object names.
    "Size" is a reserved word. (Location is not ) To avoid reserved words, you can prefix words or be a little descriptive.
    For example, "txtSize" or "ItemSize" or "Item_Size" are all good names.
    Here is a list of reserved words (a little bit old, but..... ) http://www.allenbrowne.com/AppIssueBadWord.html


    I will take it that a query does not update a table
    Some queries can update a table and some can't. Because your query has two tables related, I think the query is non-updatable.


    See for instance I have several pairs of pliers and thought that generic pliers could be in any of five locations. That was my idea. But a single table with 5 sets of pliers in different locations would just as easily be grouped into 5 with a search no pliers - only difference is that I would save myself inputting pliers for the other 4 times!!
    "Location" would/could be a field in the table as well as a field for quantity. So you could have 5 pliers at one location (bin) or 5 pliers in 5 different locations.
    In your example dB, you should have 1 table, But "box" and "bottle" are data and shouldn't be field names. (as is "package", "case", "bag"..... they are all quantities)

    I reckon a one to one is no good and my setup is wrong if I want pliers to have 5 different locations.
    Correct.

    I am using access 2007
    I still have A2000 and I know there are still people using A2002 - 2003.
    A2007 is not so old.




    Work through these tutorials (don't just read them). I will help a lot.
    http://www.rogersaccesslibrary.com/forum/forum46.html
    Search the forum - there are lots of posts about tutorials.

  4. #4
    playtime38 is offline Novice
    Windows 10 Access 2007
    Join Date
    Dec 2015
    Posts
    7
    Quote Originally Posted by Ajax View Post
    suggest show your tables rather than writing about them - will be easier for others to understand. Also you should be using as form not entering data through queries

    From what you have described, your locashin table should have a locashinid autonumber and your tools ID would then be a long which you can relate back to the tools ID in your tools table
    yes now i remember locashin auto and tools ID long - thats why it probably wont link
    2. how do i show tables ? just copy and paste in this box?
    thanks in advance

  5. #5
    playtime38 is offline Novice
    Windows 10 Access 2007
    Join Date
    Dec 2015
    Posts
    7
    ssanfu - thanks not use spaces - so item ID no good s/be itemID - yes indeed prefix or addend - I see some can some cont but i should be using form, will that update table? - box bottle are data like package case bag quantities, point taken - glad to hear you still have 2000, liked the ui and seems easier to me? - will work through tutes thanks - i like the came saw stuck around

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

Similar Threads

  1. Update Query from multiple Tables
    By nkhashab in forum Queries
    Replies: 3
    Last Post: 09-02-2014, 10:44 AM
  2. Update Query for multiple tables VBA
    By WickidWe in forum Queries
    Replies: 3
    Last Post: 12-18-2013, 05:50 PM
  3. Replies: 1
    Last Post: 12-19-2011, 12:32 PM
  4. Update 2 tables with one Update Query
    By Douglasrac in forum Queries
    Replies: 4
    Last Post: 04-14-2011, 08:33 AM
  5. Update Query that uses fields from other tables?
    By DarrenReeder in forum Queries
    Replies: 1
    Last Post: 12-06-2010, 10:47 AM

Tags for this Thread

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