Results 1 to 4 of 4
  1. #1
    etdahmer is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2014
    Posts
    3

    Update Query, Asking for user input for "Update to"


    I have an Update query that I need to run on a lot of data. For each set of data the information that is being changed/updated is the same for all records. The data that is being "Update to:" is different for each set of data. I have the query asking for user input to define the query criteria. However, I can not figure out how to have the query ask for user input to define what the updated data should be.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Personally, I would not do this with an Access query object. I never use dynamic input popup prompts. Cannot validate user input.

    Better to use a form for the user inputs and then code references the controls on form. Validation can be built into the controls and in code.

    VBA code would run an sql action statement, like:

    CurrentDb.Execute "UPDATE tablename SET fieldname='" & Me.tbxUpdateTo & "' WHERE fieldname='" & Me.tbxFilter & "'"

    This example assumes the fields involved are text type.
    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
    etdahmer is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2014
    Posts
    3
    Thank you for the reply. I had a feeling that it would be better to do it that way from what I have been reading. That is something new for me. Was trying to just create a quick and dirty way to do this. As for the data validation that isn't a problem here because this is just an Admin function that I will be doing myself.

    Thanks again for the help.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Okay, if it's just for you and not users, then by all means, use a popup prompt.

    In the UpdateTo row, just put something like: [enter value to update with]
    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.

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

Similar Threads

  1. Update Query, Inserting Variable Number of "0"
    By bigchicagobob in forum Queries
    Replies: 4
    Last Post: 03-25-2014, 07:33 AM
  2. Replies: 2
    Last Post: 08-05-2013, 06:36 PM
  3. Replies: 5
    Last Post: 06-26-2013, 02:29 PM
  4. Replies: 6
    Last Post: 07-25-2012, 06:42 AM
  5. Replies: 4
    Last Post: 11-10-2011, 03:41 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