Results 1 to 7 of 7
  1. #1
    cscura is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2014
    Posts
    3

    Ship to Store or Specify an address

    Building a RMA database. The issue I am running into is how do I get store address to auto populate in the shipping address on a form if they check the box for Ship to Store on the same form. This may sound easy but the thing is there are over 5000 different store addresses. I do have a Store number field on my Form that is a child to a Store number table that houses all the store addresses. If someone will help me write this code or have any suggestion on how to make this happen?


    Click image for larger version. 

Name:	forum.png 
Views:	9 
Size:	41.5 KB 
ID:	18392

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    One way, if you have the various fields in the combo row source (can be hidden):

    BaldyWeb - Autofill
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    cscura is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2014
    Posts
    3
    Yeah I just figured it out.
    I have all the info in the combo box and on my code for my onclick for the Ship to store combo box is:
    (code)If chkSAS = True Then txtShipAdd = [StoreIndex].Column(2)
    txtShipCity = [StoreIndex].Column(3)
    txtShipState = [StoreIndex].Column(4)
    End If
    If chkSAS = False Then
    txtShipAdd = " "
    txtShipCity = " "
    txtShipState = " "
    End If
    (/code)
    It works very well.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    After update of the STORE,
    run an update query to populate the addresses via STOREID key.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    ranman, why run an UPDATE when the record is already open on the form? - just populate the fields as cscura is doing.

    cscura, you are saving the descriptive address text into the record? Why not just save the address ID? Then to just display the address in the textboxes does not require VBA.
    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.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Quote Originally Posted by June7 View Post
    cscura, you are saving the descriptive address text into the record? Why not just save the address ID? Then to just display the address in the textboxes does not require VBA.
    If you want the actual address shipped to saved, you can't just store the ID, as stores can move. Alternative is to store each store address with a different ID, but most just keep a single record for the store and its info.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Good point Paul, if don't want the ship to address to be altered in historical records in the event customer changes locations, must save the address info or create new address record, which would probably mean another field for Active/Inactive. Similar conundrum as in product pricing - save price or create new product record.
    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. Replies: 9
    Last Post: 04-01-2014, 05:06 PM
  2. Replies: 2
    Last Post: 08-22-2013, 12:02 AM
  3. Replies: 3
    Last Post: 07-11-2013, 12:46 AM
  4. relation ship
    By sarab565 in forum Access
    Replies: 4
    Last Post: 12-02-2011, 01:53 PM
  5. Input Mask for an IP Address and Mack Address
    By baksg1995 in forum Access
    Replies: 18
    Last Post: 06-23-2009, 12:33 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