Listbox/Subform Recordsource

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Everyone,

My head is clouded and I can't seem to think straight right now. It's been a long day. :)

I'm trying to do something simple. I want to use listbox values to add new records to a table and have only those records as a source for the subform. I have created a recordset and the records are added to the table, but I can't figure out how to set the subform's record source so that records are shown corresponding to the selected listbox values. Am I making sense? Any help would be greatly appreciated. Thanks!

Snippet:

Set DB = CurrentDb
Set RecSet = DB.OpenRecordset("dbo_ProductionData", dbOpenDynaset, dbSeeChanges)

For Each Valu In Me.lbxFunctions.ItemsSelected
With RecSet
.AddNew
!CUser = "testUser"
.Fields("FunctionsID") = Me.lbxFunctions.ItemData(Valu)
.Update
End With
Next Valu

Now how do I get this info to show on my subform?
 
Back
Top