Results 1 to 2 of 2
  1. #1
    rashima is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2012

    save data from 2 listboxes into sql server db

    Hi all

    I have a form with 2 listbox controls on it. like shown below.Now I want to save this data into table "AllItems"
    i tried with this

    For i = 0 To lst_attributename.ListCount - 1
    sattributename = lst_attributename.ItemData(i)
    For j = 0 To i
    sattributevalue = lst_attributevalue.ItemData(j)
    Next j
    Next i

    this gives
    nostro 96001111 nostro 12345678 valor 96001111 valor 12345678
    and i want
    nostro 96001111 valor 12345678

    please help

    ID Name Value Tag
    1 nostro 96001111 whatever
    2 valor 12345678 whatever

    2 listboxes

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    The Great Land
    I don't understand table structure. You want all selected items as one long string in a single field?

    Have you step debugged? Follow the code as it executes. See were behavior deviates from expectations, fix, repeat. Review the link at bottom of my post.
    How to attach file: 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. Data access pages and SQL Server
    By jfloan in forum Access
    Replies: 0
    Last Post: 03-19-2012, 01:39 PM
  2. Replies: 4
    Last Post: 12-22-2011, 03:04 AM
  3. Replies: 4
    Last Post: 01-05-2011, 07:56 AM
  4. Replies: 1
    Last Post: 03-23-2010, 09:18 AM
  5. Find data, load data, and save as a new record
    By hawzmolly in forum Access
    Replies: 0
    Last Post: 10-05-2008, 03:18 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 - Senior Forums