btn to run on form open

Bilal

Registered User.
Local time
Today, 12:42
Joined
Sep 30, 2013
Messages
64
i have a form and subform with data.
the problem is that when i open the form it always shows the the first piece of data enetered and i have to click on my button which i have called btnLast. is there any way i can get the form to run button last on form open or anything like that because that would be really helpful. :)
 
When you open the form you want to show the last record on the form automatically, right?

Copy and paste the following VBA Code into the Form's Module:

Code:
Private Sub Form_Load()
Dim rst As Recordset
Set rst = Me.RecordsetClone
rst.MoveLast
Me.Bookmark = rst.Bookmark
rst.Close

End Sub
 
If you want to open the form to a New record you would open it with the Data Mode set to "Add"
 

Users who are viewing this thread

Back
Top Bottom