Results 1 to 8 of 8
  1. #1
    JakeMann41 is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2024
    Posts
    14

    Form Won't Update Table

    Hi Guys



    I have 2 tables called LocationTable and NewLocationTable

    If a location is changed in NewLocationsTable in the field Location, I have a query that updates the same field in the LocationsTable

    Can I create a form that looks at NewLocationsTable and allows me to update from there? I've been trying and so far haven't got it to work.
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Why would you use a second table to input edits that should be in first table? Why do you have two tables?

    Should bind a form to LocationTable and do edits there.

    Whatever you tried, it was not provided in posted db so no way to analyze why attempt failed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Sorry accidentally duplicated post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    ano is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2023
    Posts
    204
    Code:
    UPDATE LocationTable INNER JOIN NewLocationTable ON LocationTable.Item = NewLocationTable.Item
     SET NewLocationTable.Item = [LocationTable].[Item],
     LocationTable.Location = [NewLocationTable].[Location];
    dont know what you thinking
    why over ride item that already match?
    why is there a second table? why not just change the table if the name change?
    why is a new location not an extra location that need to be added? (insert not update)
    Last edited by ano; 09-08-2024 at 07:23 PM. Reason: wrong thinking too many same words hahaha

  5. #5
    JakeMann41 is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2024
    Posts
    14
    I'm a complete novice on Access.

    When I am binding a form I am finding that I am adding to the table every time I make a new entry. I don't want to do that, i want to update an existing field in a table with an update

  6. #6
    ano is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2023
    Posts
    204
    When I am binding a form I am finding that I am adding to the table every time I make a new entry.
    a form is for inquiry and for updating and for adding new at the bottum of the form
    read about form (create form)

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,555
    Quote Originally Posted by JakeMann41 View Post
    I'm a complete novice on Access.

    When I am binding a form I am finding that I am adding to the table every time I make a new entry. I don't want to do that, i want to update an existing field in a table with an update
    Make sure DataEntry is set to No.
    Failing that, upload the DB or enough of it to see the problem.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  8. #8
    xps35's Avatar
    xps35 is online now Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    299
    It is not clear (to me) what you really want. Two tables with the same data does not seem logical.

    Based on your previous question, I assume you want to change the location of an item. In my sample database I have created an item form. You can then choose a different location via the dropdown. You can only choose a location that already exists in the location table. If you want to use a location that is not yet in the location table, click on the button to first add that location to the location table. You can then choose the newly added location via the dropdown.
    Attached Files Attached Files
    Groeten,

    Peter

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

Similar Threads

  1. Replies: 6
    Last Post: 03-19-2021, 12:37 PM
  2. Replies: 7
    Last Post: 07-19-2016, 05:28 PM
  3. Update Table after Record Update with Form
    By speciman_A in forum Forms
    Replies: 25
    Last Post: 10-31-2014, 01:00 PM
  4. Replies: 7
    Last Post: 09-21-2012, 11:09 AM
  5. Replies: 2
    Last Post: 12-22-2010, 01:46 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