Results 1 to 5 of 5
  1. #1
    bigroo's Avatar
    bigroo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2012
    Location
    Austin, Texas
    Posts
    101

    Update Query Options/Direction

    Hi All,

    Not too sure which direction to go with this Update Query.
    I import into my database data from a website based in Mexico, it is to do with AM and FM Mexican stations. I am trying to keep my information current, looking for new stations and changes to call letters.
    The state abbreviations they use, I want to change this within my database due to the fact this data goes into another database which has different State abbreviations, mainly the two letter code instead of the 3 to 4 letters that is used within the imported data.



    I have an update query setup to change this manually, but I don't think setting up 32 update queries is the best direction due to each Mexican State, I would like to do this in one press of a button on are form if possible.
    Can I do this with VBA, are Macro or other suggestions please!!

    Here is my update query at present, manual process.

    Code:
    UPDATE MexicanData SET MexicanData.State = "AG"
    WHERE (((MexicanData.State)="Ags."));
    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,618
    Do you have a table of the corresponding abbreviations? Include that table in the query by joining on the respective 3/4-letter fields. This will make the corresponding 2-letter abbreviation available for the Update To, something like:

    SET Mexican.State = CorrespondingTable.TwoLetterState

    This does require that the same 3/4-letter abbreviations are always used in the imported data.
    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
    bigroo's Avatar
    bigroo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2012
    Location
    Austin, Texas
    Posts
    101
    Thanks June7!!

    Yes, I do have a table with the desired Mexican State codes that I can use.
    So, if I follow you correctly, I will need another column with the corresponding imported state codes with the desired state code and perform my updates from this point...correct?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,618
    Yes, you seem to have understanding.
    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.

  5. #5
    bigroo's Avatar
    bigroo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2012
    Location
    Austin, Texas
    Posts
    101
    June7,

    Thanks, your solution works great!!
    I don't know why I did not think of this myself, I guess looking at the issue too long!!

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

Similar Threads

  1. Multiple options for query criteria
    By graccess in forum Queries
    Replies: 2
    Last Post: 03-17-2014, 05:01 PM
  2. Replies: 5
    Last Post: 11-26-2013, 07:24 PM
  3. Replies: 12
    Last Post: 04-25-2013, 03:31 PM
  4. Need direction and help
    By em815 in forum Access
    Replies: 9
    Last Post: 07-17-2012, 04:13 PM
  5. Parameter query options
    By Owl in forum Queries
    Replies: 3
    Last Post: 12-07-2011, 10:43 AM

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