Is there additional code to make a recordset populate in a subform? When I add the recordset from a combobox, the associated table is updated but not the form.
Lesli CochranOP
@Reply 4 years ago
Here's my code. Excuse all the confusing misspellings of "itinerary"! ItineraryDetailT updates with the recordset but not the form. I'll post some pictures too.
Dim rsGroup As Recordset, rsGroupDetail As Recordset
Set rsGroup = CurrentDb.OpenRecordset("ItineraryDetailT")
'LOOP THROUGH DETAILS AND ADD AS TIME AND ACTIVITY
Set rsGroupDetail = CurrentDb.OpenRecordset("SELECT * FROM EventIteneraryDetailT " & _
"WHERE EventIteneraryGroupID=" & ItineraryGroupCombo, dbOpenSnapshot)
While Not rsGroupDetail.EOF
rsGroup.AddNew
rsGroup!OrderId = Forms!OrderF!OrderId
rsGroup!Activity = Nz(DLookup("ItneraryActivityName", "IteneraryActivityT", "IteneraryActivityID=" & rsGroupDetail!IteneraryActivityID), "Unknown")
rsGroup!Time = rsGroupDetail!DefaultTime
rsGroup.Update
rsGroupDetail.MoveNext
Wend
rsGroupDetail.Close
rsGroup.Close
Set rsGroupDetail = Nothing
Set rsGroup = Nothing
Me.Requery
Lesli CochranOP
@Reply 4 years ago
Kevin Robertson
@Reply 4 years ago
Did you Requery the Subform?
Lesli CochranOP
@Reply 4 years ago
Thats what I was wondering - is the "me.requery" the right code for the subform?
Adam Schwanz
@Reply 4 years ago
If you're still having trouble with this, see these.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Developer 16.