Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

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
Avatar of Neil Fleming
Neil Fleming
Flag of United Kingdom of Great Britain and Northern Ireland image

You may have to supply a sample database, or screenshots.. this is not very clear.
Avatar of Murray Brown

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

User generated image
Avatar of Daniel Pineault
Daniel Pineault

Why no simply copy the RowSource?
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't understand what   m_Params() = Split(Me.OpenArgs, ";") does and this results in a sub or function not defined error
Daniel thanks. What code would I use to copy the row source. It looks like Ste5an is doing something like that
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks very much