chrisjames25
Registered User.
- Local time
- Today, 18:14
- Joined
- Dec 1, 2014
- Messages
- 404
I have a mainform where i add invoice recrods and they are populated on the subform using the following code
This works great to add the records to the table etc and refresh the subform but the issue is my subform has space for only 10 visible records so when i add the 11th you cant see on the screen it has been added. What i want to do is go to last record at end of code but my current code goes to last record of main form not subform.
Any ideas.
Hopefully explained it ok.
Code:
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Tbl_TempInvoiceDetail")
rs.AddNew
rs.Fields("BatchNo") = Me.Lst_SearchResults.Column(1)
rs.Fields("Invoice_ID") = Me.Txt_Invoice_ID
rs.Update
rs.Close
Set rs = Nothing
db.Close
Me.Frm_ChildInvoiceForm.Requery
'DoCmd.GoToRecord , , acLast
This works great to add the records to the table etc and refresh the subform but the issue is my subform has space for only 10 visible records so when i add the 11th you cant see on the screen it has been added. What i want to do is go to last record at end of code but my current code goes to last record of main form not subform.
Any ideas.
Hopefully explained it ok.