Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update multiple colums of the table from a listbox

Status
Not open for further replies.

wshs

Programmer
Nov 22, 2005
220
0
0
US
i have a listbox /w 8 columns.

how would i update them to multiple fields in the table?

ie. listbox has

FIELD1, FIELD2, FIELD3, ETC

if user were to select a line from the list box and click OK

How can I have those information stored in the table?

am i making sense?
 
would it be possible to make the listbox bound to a "unique" column and then use dlookup to find the rest of the info?
 
Yes it would. Or you can use the Column property, starting from 0:
Me.cboCombo.Column(0)
 
im sorry but can you explain little bit more about the column property you are recommending me to use?
 
i was thinking of a combobox at first, but the same idea applies to a listbox. Perhaps you can try this, it explains better than I can:
Code:
Private Sub cmdShowMe_Click()
    If ([i]List0[/i].MultiSelect) Then
        For Each varItem In [i]List0[/i].ItemsSelected
            strList = strList & " " & [i]List0[/i].Column([red]0[/red], varItem)
        Next varItem
    Else
        strList = [i]List0[/i].Column([red]0[/red])
    End If


MsgBox "This is what you clicked: " & strList
End Sub

Change List0 to the name of your list box.
[red]0[/red] is the column number starting at 0. You can change it to show the contents for each of your eight columns.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top