Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / December 2007

Tip: Looking for answers? Try searching our database.

DoCmd.GoToRecord , , acLast

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pedro - 14 Dec 2007 11:55 GMT
Hello everyone
I have this procedure and suddnely it's not working.
I'm not an expert but it was ok.
It's like this :

Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acLast
End Sub

And when i open this form, it goes to another record when it's suppose to go
to the last one.
Any ideas? Please help me.
Tks in advance
Pedro
Douglas J. Steele - 14 Dec 2007 13:41 GMT
Try putting that code into the Load event, rather than the Open event.

The Open event fires before all of the data has been retrieved.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> Hello everyone
> I have this procedure and suddnely it's not working.
[quoted text clipped - 11 lines]
> Tks in advance
> Pedro
Allen Browne - 14 Dec 2007 13:50 GMT
You might get a better result by using the form's Load event:

   Private Sub Form_Load()
       If Not Me.NewRecord Then
           RunCommand acCmdRecordsGotoLast
       End If
   End Sub

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Hello everyone
> I have this procedure and suddnely it's not working.
[quoted text clipped - 11 lines]
> Tks in advance
> Pedro
Pedro - 17 Dec 2007 16:19 GMT
Ok. It's working. Last one :
Now if i would like to go to the highest value of a field and show me all
the record?
It's a numeric one.
ty in advance
Pedro

> You might get a better result by using the form's Load event:
>
[quoted text clipped - 19 lines]
> > Tks in advance
> > Pedro
Allen Browne - 18 Dec 2007 00:24 GMT
How about sorting the form so the highest value loads first:

Private Sub Form_Load()
   Me.OrderBy = "[YourNumericFieldNameHere] DESC"
   Me.OrderByOn = True
End Sub

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Ok. It's working. Last one :
> Now if i would like to go to the highest value of a field and show me all
[quoted text clipped - 27 lines]
>> > Tks in advance
>> > Pedro
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.