R
RGBrighton
I have a subform ('continuous forms' view) linked to the parent through the
'StaffID' field. The recordsource for the subform is a table.
For neatness I do not want an extra, blank 'new' record showing permanently
so have set 'AllowAdditions' to 'no'.
But the user will occasionally need to add/delete records on the subform.
For deletions I include record selectors - so I can select a record and
press delete.
For additions I have a button that runs this code (found from this
invaluable community):
Set rs = Me.RecordsetClone
With rs
.AddNew
!StaffID = Me.Parent("StaffID")
.Update
.Bookmark = .LastModified
End With
rs.Close
The new record is created fine. But I cannot make the new record be
selected automatically. I want the user to be able to type straight into the
new fields without having to click into them first.
Is there something missing? Or is there a better way to achieve this?
Any advice gratefully received.
Richard
'StaffID' field. The recordsource for the subform is a table.
For neatness I do not want an extra, blank 'new' record showing permanently
so have set 'AllowAdditions' to 'no'.
But the user will occasionally need to add/delete records on the subform.
For deletions I include record selectors - so I can select a record and
press delete.
For additions I have a button that runs this code (found from this
invaluable community):
Set rs = Me.RecordsetClone
With rs
.AddNew
!StaffID = Me.Parent("StaffID")
.Update
.Bookmark = .LastModified
End With
rs.Close
The new record is created fine. But I cannot make the new record be
selected automatically. I want the user to be able to type straight into the
new fields without having to click into them first.
Is there something missing? Or is there a better way to achieve this?
Any advice gratefully received.
Richard