Murray Brown
asked on
Access VBA use list box in form to update combo box
Hi
I am using the following code to open a form with a listbox on it. I want the ListBox to contain
the same data as a ComboBox that was next to the button. When the user selects an item from the listbox I want the form to close and the combobox to have that item selected
Private Sub btnManufacturer_Click()
Dim frm As Form
DoCmd.OpenForm "f_List", acNormal
Set frm = Forms("f_List")
End Sub
I am using the following code to open a form with a listbox on it. I want the ListBox to contain
the same data as a ComboBox that was next to the button. When the user selects an item from the listbox I want the form to close and the combobox to have that item selected
Private Sub btnManufacturer_Click()
Dim frm As Form
DoCmd.OpenForm "f_List", acNormal
Set frm = Forms("f_List")
End Sub
You may have to supply a sample database, or screenshots.. this is not very clear.
ASKER
Hi Neil. The image shows the ComboBox called Manufacturer_Combo. When the user clicks the button to the right it opens a form called f_List
shown to the right. I want to populate the ListBox called List1 on that form with what is in Manufacturer_Combo. When the user then selects an item from the LIst1 listbox it closes the formand puts the selected text into Manufacturer_Combo
shown to the right. I want to populate the ListBox called List1 on that form with what is in Manufacturer_Combo. When the user then selects an item from the LIst1 listbox it closes the formand puts the selected text into Manufacturer_Combo
Why no simply copy the RowSource?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I don't understand what m_Params() = Split(Me.OpenArgs, ";") does and this results in a sub or function not defined error
ASKER
Daniel thanks. What code would I use to copy the row source. It looks like Ste5an is doing something like that
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much