Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text Box Updating
I am having trouble getting a text box to auto fill from a choice made from a
combo box. Combo Box Name is Address_21 Text Box Name is City_1 My code is as follows: 'Auto Fill CES Spec Written Office Private Sub Address_21_Change() Select Case Address_21 Case ""2306 Long Green Court" City_1 = "Valrico" Case ""3440 Oakcliff Road" City_1 = "Atlanta" Case "7015 East 14th Aveneue" City_1 = "Tampa" Case "1800 Taylor Drive" City_1 = "Gastonia" End Select End Sub Can someone help me figure out what I did incorrectly? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text Box Updating
Try this
Private Sub Address_21_Change() Select Case Address_21 Case ""2306 Long Green Court" City_1.Value = "Valrico" Case ""3440 Oakcliff Road" City_1.Value = "Atlanta" Case "7015 East 14th Aveneue" City_1.Value = "Tampa" Case "1800 Taylor Drive" City_1.Value = "Gastonia" End Select End Sub "Brian" wrote: I am having trouble getting a text box to auto fill from a choice made from a combo box. Combo Box Name is Address_21 Text Box Name is City_1 My code is as follows: 'Auto Fill CES Spec Written Office Private Sub Address_21_Change() Select Case Address_21 Case ""2306 Long Green Court" City_1 = "Valrico" Case ""3440 Oakcliff Road" City_1 = "Atlanta" Case "7015 East 14th Aveneue" City_1 = "Tampa" Case "1800 Taylor Drive" City_1 = "Gastonia" End Select End Sub Can someone help me figure out what I did incorrectly? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text Box Updating
You might have one of the elements of the combobox spelled wrong. I
personally like to you the .ListIndex property instead to avoid this problem. For example, Private Sub Address_21_Change() Select Case Me.Address_21.ListIndex Case Is = 0: Me.City_1 = "Valrico" '2306 Long Green Court Case Is = 1: Me.City_1 = "Atlanta" '3440 Oakcliff Road Case Is = 2: Me.City_1 = "Tampa" '7015 East 14th Aveneue Case Is = 3: Me.City_1 = "Gastonia" '1800 Taylor Drive End Select End Sub Hope this helps! If so, let me know, click "YES" below. -- Cheers, Ryan "Brian" wrote: I am having trouble getting a text box to auto fill from a choice made from a combo box. Combo Box Name is Address_21 Text Box Name is City_1 My code is as follows: 'Auto Fill CES Spec Written Office Private Sub Address_21_Change() Select Case Address_21 Case ""2306 Long Green Court" City_1 = "Valrico" Case ""3440 Oakcliff Road" City_1 = "Atlanta" Case "7015 East 14th Aveneue" City_1 = "Tampa" Case "1800 Taylor Drive" City_1 = "Gastonia" End Select End Sub Can someone help me figure out what I did incorrectly? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text Box Updating
see if this change to your code helps:
Private Sub Address_21_Change() With Me Select Case .Address_21.Text Case "2306 Long Green Court" .City_1.Text = "Valrico" Case "3440 Oakcliff Road" .City_1.Text = "Atlanta" Case "7015 East 14th Aveneue" .City_1.Text = "Tampa" Case "1800 Taylor Drive" .City_1.Text = "Gastonia" End Select End With End Sub -- jb "Brian" wrote: I am having trouble getting a text box to auto fill from a choice made from a combo box. Combo Box Name is Address_21 Text Box Name is City_1 My code is as follows: 'Auto Fill CES Spec Written Office Private Sub Address_21_Change() Select Case Address_21 Case ""2306 Long Green Court" City_1 = "Valrico" Case ""3440 Oakcliff Road" City_1 = "Atlanta" Case "7015 East 14th Aveneue" City_1 = "Tampa" Case "1800 Taylor Drive" City_1 = "Gastonia" End Select End Sub Can someone help me figure out what I did incorrectly? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text Box Updating
Works perfectly
Thanks "Mike" wrote: Try this Private Sub Address_21_Change() Select Case Address_21 Case ""2306 Long Green Court" City_1.Value = "Valrico" Case ""3440 Oakcliff Road" City_1.Value = "Atlanta" Case "7015 East 14th Aveneue" City_1.Value = "Tampa" Case "1800 Taylor Drive" City_1.Value = "Gastonia" End Select End Sub "Brian" wrote: I am having trouble getting a text box to auto fill from a choice made from a combo box. Combo Box Name is Address_21 Text Box Name is City_1 My code is as follows: 'Auto Fill CES Spec Written Office Private Sub Address_21_Change() Select Case Address_21 Case ""2306 Long Green Court" City_1 = "Valrico" Case ""3440 Oakcliff Road" City_1 = "Atlanta" Case "7015 East 14th Aveneue" City_1 = "Tampa" Case "1800 Taylor Drive" City_1 = "Gastonia" End Select End Sub Can someone help me figure out what I did incorrectly? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel not updating text boxes | Excel Discussion (Misc queries) | |||
countin and updating numbric and text | Excel Discussion (Misc queries) | |||
Updating Split Text field | Excel Discussion (Misc queries) | |||
updating a text box | Excel Programming | |||
Updating a Text Box in my Workbook | Excel Programming |