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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving Listbox entries to database

Status
Not open for further replies.

Sw0rdfish149

Programmer
Joined
Jan 18, 2004
Messages
15
Location
GB
Hi there everyone,
I've got a listbox that has several entries, each with several items in seperated by
& vbtab &

and I've been trying to figure out to save each listbox entry as a new record in an Access db, with each item in a different field.

any answers?

Sw0rdfish149
 

One way:

List1.AddItem "one" & vbTab & "two" & vbTab & "three"
List1.AddItem "four" & vbTab & "five" & vbTab & "six"

For i = 0 To List1.ListCount - 1
[green]' new record[/green]
arr = Split(List1.List(i), vbTab)
For j = 0 To UBound(arr)
[green]'set field values[/green]
Debug.Print arr(j)
Next
[green]' update record[/green]
Next


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top