Continuous Form Questions

  • Thread starter Thread starter Samantha
  • Start date Start date
S

Samantha

I have a continous form used for entering invoices and
related invoice info. I have it set so that the cursor
automatically goes to the invoice number field of a new
record. When the form first opens, it only displays that
new blank record where the cursor is. You have to scroll
up to see the other entries.

Is there a way to make the form open and show the last
record as well as put the cursor in the first field of the
new record. We need to know what the last invoice number
was each time we open the form.

Thanks for your help!
Samantha
 
Samantha said:
I have a continous form used for entering invoices and
related invoice info. I have it set so that the cursor
automatically goes to the invoice number field of a new
record. When the form first opens, it only displays that
new blank record where the cursor is. You have to scroll
up to see the other entries.

Is there a way to make the form open and show the last
record as well as put the cursor in the first field of the
new record. We need to know what the last invoice number
was each time we open the form.


Here's some code that does that kind of thing:

Private Sub Form_Load()
With Me.RecordsetClone
.MoveLast
.Move -4
Me.Bookmark = .Bookmark
End With
DoCmd.GoToRecord , , acNewRec
End Sub

Change the -4 to whatever fits your form or remove the line
if you only want the one previous record.
 
Back
Top