PC Review


Reply
Thread Tools Rate Thread

create dynamic comboboxes

 
 
Martin
Guest
Posts: n/a
 
      3rd Jul 2009

Hello,

is it possible to create dynamic combo boxes?

I have an userform which saves the file into a specified folder. The user
can choose one out of 4 predefined folders from a combobox. I want to add a
button "Add folder", by what the user can enter the path and the folder would
appear in the comobbox.

The users are not proficient to fill the combobox via VBA and I want them to
be able to add folders without proggramming.

thank you

Martin
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      3rd Jul 2009

If the combobox is populated using RowSource, then the code behind the
command button would have to resize the row source range and add the new
folder to the rowsource range.

If the combobox is populated during the initialize event using the add item
method, then the command button code can use the add item method to add the
new folder to the combo box list as below.

Private Sub CommandButton1_Click()
ComboBox1.AddItem Selection
End Sub

This assumes the user will have typed a new folder name into a cell and
then selects that cell.













 
Reply With Quote
 
Patrick Molloy
Guest
Posts: n/a
 
      3rd Jul 2009

if you have a text box above the listbox, and a button next to at , your
user can tyep the address in the textbox then click the button
the button's click event should be

listbox1.AddItem Textbox1.text
' these next two are optional
textbox1.text=""
listbox1.listindex = listbox1.listcount-1
'
this clears the textbox and highlights the last row of the listbox. this
though is akin to clicking the list box ...so don't use this if you're
trapping the listbox click event


"Martin" <(E-Mail Removed)> wrote in message
news:91B46866-A3C1-4AFF-8D5D-(E-Mail Removed)...
> Hello,
>
> is it possible to create dynamic combo boxes?
>
> I have an userform which saves the file into a specified folder. The user
> can choose one out of 4 predefined folders from a combobox. I want to add
> a
> button "Add folder", by what the user can enter the path and the folder
> would
> appear in the comobbox.
>
> The users are not proficient to fill the combobox via VBA and I want them
> to
> be able to add folders without proggramming.
>
> thank you
>
> Martin


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create List for ComboBoxes Benjamin Microsoft Excel Programming 4 20th Oct 2009 02:16 AM
How to create Dynamic Display?? Asad Ul-Islam Windows XP Messenger 1 26th Feb 2008 02:25 AM
Dynamic SQL statement to cascade comboboxes =?Utf-8?B?U2V0aA==?= Microsoft Access Forms 2 3rd Jul 2005 03:01 AM
How do I create custom collections that can be bound to comboboxes? Don Microsoft VB .NET 2 8th Nov 2004 03:01 PM
How to create Dynamic Controls RSB Microsoft ASP .NET 3 24th Apr 2004 12:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:11 PM.