A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

goto last record of a list box



 
 
Thread Tools Display Modes
  #1  
Old August 20th, 2004, 05:26 AM
Phil
external usenet poster
 
Posts: n/a
Default goto last record of a list box

HI,

Is it possible to goto the last record of a list box when
a FORM is opened. I have a list box that pulls data from
a large table and if the box would goto the last record
then all the data would be in the box sooner.

Sound crazy???? I don't know......

Thanks,
Phil
  #2  
Old August 20th, 2004, 05:52 AM
Graham R Seach
external usenet poster
 
Posts: n/a
Default

Phil

If Me!lstMyList.ListCount 0 Then
Me!lstMyList = Me!lstMyList.ItemData(Me!lstMyList.ListCount - 1)
End If

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"Phil" wrote in message
...
HI,

Is it possible to goto the last record of a list box when
a FORM is opened. I have a list box that pulls data from
a large table and if the box would goto the last record
then all the data would be in the box sooner.

Sound crazy???? I don't know......

Thanks,
Phil



  #3  
Old August 20th, 2004, 06:11 AM
Phil
external usenet poster
 
Posts: n/a
Default

Thanks,
That works perfect. Others who have large amounts data
for a list box might want to remember this code also. I
tried it and it also works in a combo box.

Thanks again
Phil
-----Original Message-----
Phil

If Me!lstMyList.ListCount 0 Then
Me!lstMyList = Me!lstMyList.ItemData(Me!

lstMyList.ListCount - 1)
End If

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-

0764559036.html


"Phil" wrote in

message
...
HI,

Is it possible to goto the last record of a list box

when
a FORM is opened. I have a list box that pulls data

from
a large table and if the box would goto the last record
then all the data would be in the box sooner.

Sound crazy???? I don't know......

Thanks,
Phil



.

  #4  
Old August 20th, 2004, 03:21 PM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

An alternative is to force the listbox to fill entirely in the form's OnLoad
event:

Private Sub Form_Load()
Dim lngCount As Long
lngCount = Me.ListBoxName.ItemCount
End Sub

--

Ken Snell
MS ACCESS MVP

"Phil" wrote in message
...
HI,

Is it possible to goto the last record of a list box when
a FORM is opened. I have a list box that pulls data from
a large table and if the box would goto the last record
then all the data would be in the box sooner.

Sound crazy???? I don't know......

Thanks,
Phil



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear the "Recent Files" list in the hyperlink window Mike Powerpoint 15 July 22nd, 2004 02:51 AM
synchronizing form and list box Deb Smith Using Forms 8 June 21st, 2004 08:15 PM
Select record from a list Andrea Using Forms 2 June 15th, 2004 11:25 PM
finding & sorting unqiue names list iwtci Worksheet Functions 6 June 6th, 2004 06:43 AM


All times are GMT +1. The time now is 08:53 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.