A
Anubix
I have a form with a list box for LastName and a tabbed control with
fields related to the person selected in the list box. The list box
is working fine when you click it, the fields show the proper
information. My problem is when I save a new person.
I'm using the following code to save a newly created record.
Private Sub cmdSaveFamily_click()
'Code that saves the record goes here...
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.RecordsetClone
rs.FindNext "[FamilyID] = " & Str(Me![FamilyID])
Me.Bookmark = rs.Bookmark
List6.Requery
List6.SetFocus
End Sub
The record is being saved but the listbox shows the first record in
the table. the FamilyID is the first one. I've tried with or without
the last two lines (Requery and SetFocus). There's no change in
behavior.
I've also tried with FindFirst and FindLast, behavior is the same.
I want it so that when I save a new record, the list box goes to the
last record saved and selects it, and so that it also selects the same
record for the related fields in the tabbed control.
fields related to the person selected in the list box. The list box
is working fine when you click it, the fields show the proper
information. My problem is when I save a new person.
I'm using the following code to save a newly created record.
Private Sub cmdSaveFamily_click()
'Code that saves the record goes here...
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.RecordsetClone
rs.FindNext "[FamilyID] = " & Str(Me![FamilyID])
Me.Bookmark = rs.Bookmark
List6.Requery
List6.SetFocus
End Sub
The record is being saved but the listbox shows the first record in
the table. the FamilyID is the first one. I've tried with or without
the last two lines (Requery and SetFocus). There's no change in
behavior.
I've also tried with FindFirst and FindLast, behavior is the same.
I want it so that when I save a new record, the list box goes to the
last record saved and selects it, and so that it also selects the same
record for the related fields in the tabbed control.