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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |