Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update a table based on list box selection (Acc2K, Win2KPro)

    I am assembling an 'address picker' and use a concatenated field to show the complete address for a user to select, if desired. The system should update the current record's address1, address2, city, state and zip fields based on the selection. In order to do this, I need to maintain the 'atomized' address data for the update, but I don't want to display it (I could if needed but don't want to). So, I have a pop-up form with a concatenated fields based on a SELECT Distinct to the table supporting the main form and thought I could add the separate addresses to the listbox form source and add them to the listbox control as hidden columns. Now I am stuck on the syntax to read the hidden columns in order to load an UPDATE SQL command in code.

    Any ideas?

    TIA

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Update a table based on list box selection (Acc2K, Win2KPro)

    The n-th column of the selected item in a list box lstAddresses is Me.lstAddresses.Column(n - 1). You have to subtract 1 because the column index starts at 0.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update a table based on list box selection (Acc2K, Win2KPro)

    great - that worked. just a simple syntax issue this time...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •