Open Form To Last Record

A

Anthony Viscomi

I seem to be having a "brain freeze"; I have the following VBA and would
like for the frm to open to the last record:
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Transactions Subform"
stLinkCriteria = "[SS]=" & "'" & Me![SS] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

The form is opened via a cmdButton on another form.

Thanks!
Anthony
 
G

Guest

hi,
what is the problem? form not opening to last record or
just not opening? what is SS?
what i saw first was Me![SS]. you have 2 forms open. which
form does me refer to?
Post more info
 
A

Anthony Viscomi

The form is not opening to last record
hi,
what is the problem? form not opening to last record or
just not opening? what is SS?
what i saw first was Me![SS]. you have 2 forms open. which
form does me refer to?
Post more info
-----Original Message-----
I seem to be having a "brain freeze"; I have the following VBA and would
like for the frm to open to the last record:
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Transactions Subform"
stLinkCriteria = "[SS]=" & "'" & Me![SS] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

The form is opened via a cmdButton on another form.

Thanks!
Anthony


.
 
G

Guest

hi again,
guess on my part but try changeing me.[SS] to
[Forms]![Form1]![SS]
i think the me![SS] is confusing access.
-----Original Message-----
The form is not opening to last record
hi,
what is the problem? form not opening to last record or
just not opening? what is SS?
what i saw first was Me![SS]. you have 2 forms open. which
form does me refer to?
Post more info
-----Original Message-----
I seem to be having a "brain freeze"; I have the following VBA and would
like for the frm to open to the last record:
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Transactions Subform"
stLinkCriteria = "[SS]=" & "'" & Me![SS] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

The form is opened via a cmdButton on another form.

Thanks!
Anthony


.


.
 
B

Brian

Could also add this in Form_Open of the form being opened.

DoCmd.GoToRecord acForm, Me.Name, acLast

Ensure RecordSource of form is sorted the way you want.
 

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