Open Form To Last Record

  • Thread starter Thread starter Anthony Viscomi
  • Start date Start date
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
 
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
 
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


.
 
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


.


.
 
Actually, I may have solved the issue by assigning a descending sort the an
Index field
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


.


.
 
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.
 
Anthony, if you want the form to open with all records, but view the one you
were working on last, see:
Return to the same record next time form is opened
at:
http://members.iinet.net.au/~allenbrowne/ser-18.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Anthony Viscomi said:
Actually, I may have solved the issue by assigning a descending sort the
an Index field
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
 
Back
Top