last record

W

Wstanley

I developed a split database application and, after everything was working
great, moved to a SQL Server backend. All is well except the DoCmd that I
used in the event procedure to advance to the last record no longer works.
When the form loaded, the last record would be displayed as the default. I
tried to use the RunSQL method but was not successful. Any ideas?

Thanks,
Bill
 
M

Marshall Barton

Wstanley said:
I developed a split database application and, after everything was working
great, moved to a SQL Server backend. All is well except the DoCmd that I
used in the event procedure to advance to the last record no longer works.
When the form loaded, the last record would be displayed as the default. I
tried to use the RunSQL method but was not successful. Any ideas?


Using DAO, I think all you need is:

With Me.RecordsetClone
.MoveLast
Me.Bookmark = .Bookmark
End With

If you're using ADO, I can't help other than to suspect that
the same or something similar should be available.
 
D

Daniel M

I was able to do this by putting this in the default value field. It jumped
to the last record and added 1. you can just delete the +1 if you dont need
it.

=DMax("rma_number","rma_log")+1

rma_log is my table and rma_number is the control source.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top