I'm having problems with a subform that has a list box and three fields under the list box.
All i want to do is have the fields under the listbox display with the record clicked in the list box. I've done this heaps of times before, but can't quite work out why this one is any different.
I have tried heaps of different ways of doing this, and this is my latest attempt.
Dim rst As Object
Dim dbs As Object
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("invites", dbOpenDynaset)
rst.FindFirst "[InviteeID] = " & [Forms]![Events]![eventsSubformINV]![List4]
If Not rst.EOF Then Me.Bookmark = rst.Bookmark
this comes up with an error sayng 'Not a valid bookmark' for the last line.
Another thing i tried was
Dim rs As Object
Set rs = Forms![Events]![eventsSubformINV].Form.RecordsetClone
rs.FindFirst "[InviteeID] = " & Me.List4
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
which just doesnt even find the record at all, even tho it is there when i run this when the form is by itself instead of a subform.
I know its something to do with the record set changing when you reference it from a subform, but it got me stuffed.
Any help would be appreciated.
Ben
All i want to do is have the fields under the listbox display with the record clicked in the list box. I've done this heaps of times before, but can't quite work out why this one is any different.
I have tried heaps of different ways of doing this, and this is my latest attempt.
Dim rst As Object
Dim dbs As Object
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("invites", dbOpenDynaset)
rst.FindFirst "[InviteeID] = " & [Forms]![Events]![eventsSubformINV]![List4]
If Not rst.EOF Then Me.Bookmark = rst.Bookmark
this comes up with an error sayng 'Not a valid bookmark' for the last line.
Another thing i tried was
Dim rs As Object
Set rs = Forms![Events]![eventsSubformINV].Form.RecordsetClone
rs.FindFirst "[InviteeID] = " & Me.List4
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
which just doesnt even find the record at all, even tho it is there when i run this when the form is by itself instead of a subform.
I know its something to do with the record set changing when you reference it from a subform, but it got me stuffed.
Any help would be appreciated.
Ben