drill down functionality list
RH

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

resolvedResolved · 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 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.


 

Access tip:

Related tables

When you have related tables such as Customers and their Orders, the Customer table is the Primary table.

Open the Customers table in datasheet view and go to the Home Tab and Records group. Click on the More option and choose Subdatasheet and then click on Subdatasheet again. Now choose the related table (Orders) and click ok.

Now you can click the + symbol by each company to show the related orders.

View all Access hints and tips


Server loaded in 0.05 secs.