based on combobox text select textbox for add data

shalva.gelashvili

New member
Local time
Tomorrow, 02:08
Joined
Sep 6, 2008
Messages
6
Hi everybody,

I have a combo1 with values "Jan, Feb, Mar, Apr, May"

also text boxes - Jan , Feb, Mar, Apr, May

based on combo1 selection add some data to the textbox which hase the same name as combo1 selection

Thanks
 
Hi everybody,

I have a combo1 with values "Jan, Feb, Mar, Apr, May"

also text boxes - Jan , Feb, Mar, Apr, May

based on combo1 selection add some data to the textbox which hase the same name as combo1 selection

Thanks

try using OnChange event of the Combobox...
then inside it, append the value of the textbox...
you said "add", right?
 
not exactly

I have some variable i

i want to append i to the text box which has the same name as the selected combo box
 
Why do you have separate fields for each month?
 
the easy way would be
in On_Cange event :
Select Case [Me]![Combo1]
Case "Jan"
[Me]![jan] = [Me]![Combo1]
Case "Feb"
[Me]![feb] = [Me]![Combo1]

etc..

Case Else
[Me]![jan]=""
[Me]![feb]=""
etc..
End Select
 
I prefer nightmayor's solution because it's clear what the code is doing...

Code:
 Select Case ComboName.Value
     Case "Jan"
       Me.Jan = "Hi"
     Case "Feb"
       Me.Feb = "Hi"
     Case "Mar"
       Me.Mar = "Hi"
 End Select

Yet you could also do this...

Code:
  Forms(Me.Name)(Me.ComboName.Value) = "blah"

Regards,
Tim
 

Users who are viewing this thread

Back
Top Bottom