Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change value of text box from Combo box value 2

Status
Not open for further replies.

aarat260980

Technical User
Oct 12, 2001
28
GB
Hello guys, Let me give u some info about the database. It is about income/expense, my major importance is on Expense and i have divided expense in this manner
1)Car ---> Services, Roadtax, Carwash, Insurance & Repair
2)Petrol --> Petrol
3)House --> Electricity, Gas, Water, Telephone(H), Insurance(H),Mortgage.
4)Other -->Telephone(M), Laundry, Postage+Stationary
Now on my form there is a combo box called expense type in which in contains the expense type for eg: Services, RoadTax....Gas. what i want is on that basis i want my text box called Group to appear as either Car, Petrol, house or Other. I will appreciate your help .
Please help me
Thanks
Aarat Patel
 
a select case on the after update of the combo box might help you.

select case combo1.value

case as "Carwash"
group.setfocus
group.text=combo1.value
break
end select

and so on...
hth
alcar
 
Thank Alcar but sorry i didn;t mention about case, if ..else
. I don't want to use them as i want the program to be easy to understand for the person. say apart from
)Car ---> Services, Roadtax, Carwash, Insurance & Repair

2)Petrol --> Petrol

3)House --> Electricity, Gas, Water, Telephone(H), Insurance(H),Mortgage.

4)Other -->Telephone(M), Laundry, Postage+Stationary

this fields if he wants to add some more than he will have to call me again .so i thought better not to use them
Please give some other suggestions
Thanks
Aarat Aarat H Patel
 
Aarat,

How is the query for the combobox structured? Like this?
Code:
Car        Services
Car        Roadtax
Car        Carwash
Car        Insurance
Car        Repair  
Petrol     Petrol
House      Electricity
House      Gas
house      Water
House      Telephone(H)
House      Insurance(H)
House      Mortgage
Other      Telephone(M)
Other      Laundry
Other      Postage+Stationary

If this is how the query is structured (or could be structured), you would have the ComboBox BeforeUpdate event set your textbox value:
Code:
TextBox = ComboBox.Column(0)

If it's another structure, post back with an explanation.


HTH

John
 
Hi John It's exactly the way i have structured my combo box but when the form is run when Add expense button is click only expense value combox appear with the values petrol,water, gas,repairs ....laundry. so if water is selected from combox House should appear in text box.
Hope now i have clarified my self
I will try u r suggestion
Thanks

Aarat H Patel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top