Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Identify what Combobox was changed to update the correct item on the previous Form

I am trying to identify a particular Combobox on a form.
There is 21 in total(cmb23-43)

If a particular value is selected fromt he combobox, then another
userform(5) is shown.

The user then inputs a numeical value and click OK.

Using the commandbutton to OK, i need to identify what combobox triggered
the Userform5 to open, so i can then have the correct item updated.

EG. If Combobox23 value was changed and triggered the Userform5, then the
value entered into Userform5 would then be (Label1.caption =
Userform5.Textbox1.value)

If Combobox25 value was changed and triggered the Userform5, then the value
entered into Userform5 would then be (Label2.caption =
Userform5.Textbox1.value)

and so on .....................


I do not want to have 21 identical Userform's to input a value, but want to
be able to use the same Userform5 for all 21 Comboboxes.

How can i do this with the Userform5.CommandButton1_Click Event, to identfy
what Combobox was changed to then update the correct label on Userform1 ?



Ctm


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Identify what Combobox was changed to update the correct item on t

hi
what code calls userform(5)? code in combo box?
if so then you might be able to use a little trick i have use in the past.
put a small text box on the main form, hidden so that the user can't see it.
then have the combo box code put it's id number in the hidden text box.
the code in commandbutton1 can then do a select case based on what id number
is in the hidden textbox.
there may be other ways but i have used this trick before and it works.

Regards
FSt1
"Corey ...." wrote:

I am trying to identify a particular Combobox on a form.
There is 21 in total(cmb23-43)

If a particular value is selected fromt he combobox, then another
userform(5) is shown.

The user then inputs a numeical value and click OK.

Using the commandbutton to OK, i need to identify what combobox triggered
the Userform5 to open, so i can then have the correct item updated.

EG. If Combobox23 value was changed and triggered the Userform5, then the
value entered into Userform5 would then be (Label1.caption =
Userform5.Textbox1.value)

If Combobox25 value was changed and triggered the Userform5, then the value
entered into Userform5 would then be (Label2.caption =
Userform5.Textbox1.value)

and so on .....................


I do not want to have 21 identical Userform's to input a value, but want to
be able to use the same Userform5 for all 21 Comboboxes.

How can i do this with the Userform5.CommandButton1_Click Event, to identfy
what Combobox was changed to then update the correct label on Userform1 ?



Ctm



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Identify what Combobox was changed to update the correct item on t

FSt1,
Cheers.
Your idea worked for my problem.

Thanks


"FSt1" wrote in message
...
hi
what code calls userform(5)? code in combo box?
if so then you might be able to use a little trick i have use in the past.
put a small text box on the main form, hidden so that the user can't see
it.
then have the combo box code put it's id number in the hidden text box.
the code in commandbutton1 can then do a select case based on what id
number
is in the hidden textbox.
there may be other ways but i have used this trick before and it works.

Regards
FSt1
"Corey ...." wrote:

I am trying to identify a particular Combobox on a form.
There is 21 in total(cmb23-43)

If a particular value is selected fromt he combobox, then another
userform(5) is shown.

The user then inputs a numeical value and click OK.

Using the commandbutton to OK, i need to identify what combobox
triggered
the Userform5 to open, so i can then have the correct item updated.

EG. If Combobox23 value was changed and triggered the Userform5, then the
value entered into Userform5 would then be (Label1.caption =
Userform5.Textbox1.value)

If Combobox25 value was changed and triggered the Userform5, then the
value
entered into Userform5 would then be (Label2.caption =
Userform5.Textbox1.value)

and so on .....................


I do not want to have 21 identical Userform's to input a value, but want
to
be able to use the same Userform5 for all 21 Comboboxes.

How can i do this with the Userform5.CommandButton1_Click Event, to
identfy
what Combobox was changed to then update the correct label on Userform1 ?



Ctm





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to display the first Item in a combobox as the default item Nigel Excel Programming 2 December 8th 06 10:21 PM
How to display the first Item in a combobox as the default item Jim Cone Excel Programming 0 December 8th 06 06:42 PM
Multiselect Listbox - identify if item picked apndas[_12_] Excel Programming 5 July 27th 06 03:23 AM
Identify last item in a list Greg Excel Discussion (Misc queries) 6 March 16th 05 11:47 PM
Add item to comboBox "form" from vba 0000_AAAA_0000[_6_] Excel Programming 1 November 1st 04 03:47 AM


All times are GMT +1. The time now is 07:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"