98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access VBA Training and help » Drill down functionality on list boxes
Drill down functionality on list boxes
Resolved · High Priority · Version 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 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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Related tablesWhen you have related tables such as Customers and their Orders, the Customer table is the Primary table. |