[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

VB Code to select a record in a listbox control in Access

Asked by dstjohnjr in SQL Query Syntax, Access Architecture/Design, VB Script

I have some code in Access 2003 that is doing a few things here, but most importantly, I would like for it to select the Last record in the FormIndex instead of the first record which is what it is doing now.  I am guessing the line that needs changed is:

Me!FormIndex = Me!SelectRecord

I'm just not sure what to change it to in order to select the last record.  Thanks for any assistance!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
Private Sub SelectRecord_AfterUpdate()
On Error Resume Next
    void = LaunchSelect()
    Screen.ActiveForm.Filter = Null
    Requery
    Me!FormIndex = Me!SelectRecord
    DoCmd.GoToControl "FormID"
    DoCmd.FindRecord Me!SelectRecord
    Me!FormID.SetFocus
    Me!SelectRecord = Null
End Sub
[+][-]11/06/09 02:20 PM, ID: 25763585Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 02:31 PM, ID: 25763653Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/07/09 01:45 PM, ID: 25768197Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625