Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

drill down functionality list

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » Drill down functionality on list boxes

Drill down functionality on list boxes

ResolvedVersion 2003

Richard has attended:
Access VBA course

Drill down functionality on list boxes

Would like to get coding so I can select an item within a list box and open a relating form in VB

RE: Drill down functionality on list boxes

Hi Richard

Thanks for the question, I hope I have an easy answer to solve it.

You need to add code to the event Change on the combo box. Here is a simple example.


Private Sub cmdFormName_Change()
Select case me.cmbFormName
case "Menu"
DoCmd.OpenForm "frm Menu"
case "Options"
DoCmd.OpenForm "frm Options"
End Select
End Sub


Does that help?

Laura GB

RE: Drill down functionality on list boxes

Hi Laura,

Thanks for the reply. I didnt explain myself too well. The issue im having is when there is more than one column within a list box (not a combo). I need to know how to get vba to pull out a partucular value within a specific column. The example im using at the moment has about seven columns.

Kind regards,
Richard

RE: Drill down functionality on list boxes

Hi Richard

I think I have a neat solution for you although its not an obvious one. Here is an example that will msgbox the third column, (first column is column 0). This will work for list boxes that have single or multiple selection allowed.


Dim ListItem As Variant
For Each ListItem In Me.MyListBox.ItemsSelected
MsgBox Me.MyListBox.Column(2, ListItem)
Next ListItem


I hope that helps.

Laura

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.