Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default 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
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
excel not updating text boxes lbbeurmann Excel Discussion (Misc queries) 2 March 3rd 10 09:03 PM
countin and updating numbric and text Anvil22 Excel Discussion (Misc queries) 8 February 21st 10 10:15 PM
Updating Split Text field jock Excel Discussion (Misc queries) 2 April 16th 08 01:07 PM
updating a text box DirInfo Excel Programming 3 February 2nd 05 08:49 PM
Updating a Text Box in my Workbook Chaplain Doug Excel Programming 3 January 1st 05 05:24 PM


All times are GMT +1. The time now is 08:58 PM.

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"