NeedsHelp101
Technical User
Hi,
I'm trying to create a loop that will write the values selected from an extended multiselect list box to a table.
Table = TrafficForForm
Market = column in the table to be populated
lstMarket = the multiselect list box
The commented out lines are ones I think might be wrong or unecessary.
Here's the code:
***
Dim dbMarketing As Database
Dim ForresterMarket As String
Dim rec As Recordset
Dim lstMarket As ListBox
Set dbMarketing = CurrentDb()
Set rec = dbMarketing.OpenRecordset("TrafficForForm")
'Set ForresterMarket =
'Set lstMarket =
For Each ForresterMarket In Me.lstMarket.ItemsSelected
rec.AddNew
'TrafficForForm!Market = Me.lstMarket.ItemData(Market)
rec.Update
Debug.Print ForresterMarket
End With
Next
'Set dbMarketing = Nothing
***
Any help would be amazing!!
I'm trying to create a loop that will write the values selected from an extended multiselect list box to a table.
Table = TrafficForForm
Market = column in the table to be populated
lstMarket = the multiselect list box
The commented out lines are ones I think might be wrong or unecessary.
Here's the code:
***
Dim dbMarketing As Database
Dim ForresterMarket As String
Dim rec As Recordset
Dim lstMarket As ListBox
Set dbMarketing = CurrentDb()
Set rec = dbMarketing.OpenRecordset("TrafficForForm")
'Set ForresterMarket =
'Set lstMarket =
For Each ForresterMarket In Me.lstMarket.ItemsSelected
rec.AddNew
'TrafficForForm!Market = Me.lstMarket.ItemData(Market)
rec.Update
Debug.Print ForresterMarket
End With
Next
'Set dbMarketing = Nothing
***
Any help would be amazing!!