Forums

This topic is locked

Multiple Inserts from List Box

Posted 19 Feb 2001 18:02:29
1
has voted
19 Feb 2001 18:02:29 Jack Gillespie posted:
I'm having diffulty inserting records to a single Access table based on the value(s) contained in a multiple list box. The code I'm using is as follows:

IF Request("btnSave" <> "" Then
Dim oElements, oDropdown, oOption
Dim sSelected
Set oElements = Document.form7.Elements
set oDropDown = oElements("lstOffices"
For each oOption in lstOffices.Options
If lstOffices.Selected
frmAvailable.AddNew
frmAvailable.Fields("PersonID" = HideID
frmAvailable.Fields("OfficeID" = oOption.Value
frmAvailable.Fields("Locale" = oOption.Text
frmAvailable.Update
End if
Next
End IF

Are there any extensions, behaviors, etc. that you know of to accomplish this task?

Thanks for any help you can provide.

Jack

Reply to this topic