Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default List & Text Box Problem

Hi All

I select the customer from a ListBox (Lb1) all the address data etc, enters
the Text Boxes OK. the ListBox is populated via RowSource. The ComboBox (Cb1)
is populated via "Add Item" on UserForm Initialize select an item from Cb1
and Tb6 and Tb7 fill Ok and can be entered on the sheet with all the other
data.

Private Sub Cb1_Click()
Sheets("Customers").Select
Dim iRow As Long
Dim ws As Worksheet
rownum = Lb1.ListIndex
UserForm1.Tb6.Value = Lb1.List(, 5)
UserForm1.Tb7.Value = Lb1.List(, 6)

End Sub

Is it possible to select another item in Cb1 using Tb6 & Tb7 as below or
would I need multiple TextBoxes

UserForm1.Tb6.Value = Lb1.List(, 7)
UserForm1.Tb7.Value = Lb1.List(, 8)

Hope I have made my problem an easy and understandable query.


--
Many thanks

hazel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default List & Text Box Problem

hi,

Just guess your query:

try to use :
Private Sub Cb1_Change()
Tb6 = Lb1.list(Cb1.listindex , 6)
Tb7 = Lb1.list(Cb1.listindex , 7)
Tb8 = Lb1.list(Cb1.listindex , 8)
End sub

change Cb1.listindex to achieve your query.
--
Regards,

Halim



"Hazel" wrote:

Hi All

I select the customer from a ListBox (Lb1) all the address data etc, enters
the Text Boxes OK. the ListBox is populated via RowSource. The ComboBox (Cb1)
is populated via "Add Item" on UserForm Initialize select an item from Cb1
and Tb6 and Tb7 fill Ok and can be entered on the sheet with all the other
data.

Private Sub Cb1_Click()
Sheets("Customers").Select
Dim iRow As Long
Dim ws As Worksheet
rownum = Lb1.ListIndex
UserForm1.Tb6.Value = Lb1.List(, 5)
UserForm1.Tb7.Value = Lb1.List(, 6)

End Sub

Is it possible to select another item in Cb1 using Tb6 & Tb7 as below or
would I need multiple TextBoxes

UserForm1.Tb6.Value = Lb1.List(, 7)
UserForm1.Tb7.Value = Lb1.List(, 8)

Hope I have made my problem an easy and understandable query.


--
Many thanks

hazel

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default List & Text Box Problem

Hi Halim

The Change Event sets off the debugger because at the start TB6 is empty and
it appears I will have to have many textboxes because we have so many columns
to cover on the worksheet might have to go in a different direct to get this
working properly.
--
Many thanks

hazel


"Halim" wrote:

hi,

Just guess your query:

try to use :
Private Sub Cb1_Change()
Tb6 = Lb1.list(Cb1.listindex , 6)
Tb7 = Lb1.list(Cb1.listindex , 7)
Tb8 = Lb1.list(Cb1.listindex , 8)
End sub

change Cb1.listindex to achieve your query.
--
Regards,

Halim



"Hazel" wrote:

Hi All

I select the customer from a ListBox (Lb1) all the address data etc, enters
the Text Boxes OK. the ListBox is populated via RowSource. The ComboBox (Cb1)
is populated via "Add Item" on UserForm Initialize select an item from Cb1
and Tb6 and Tb7 fill Ok and can be entered on the sheet with all the other
data.

Private Sub Cb1_Click()
Sheets("Customers").Select
Dim iRow As Long
Dim ws As Worksheet
rownum = Lb1.ListIndex
UserForm1.Tb6.Value = Lb1.List(, 5)
UserForm1.Tb7.Value = Lb1.List(, 6)

End Sub

Is it possible to select another item in Cb1 using Tb6 & Tb7 as below or
would I need multiple TextBoxes

UserForm1.Tb6.Value = Lb1.List(, 7)
UserForm1.Tb7.Value = Lb1.List(, 8)

Hope I have made my problem an easy and understandable query.


--
Many thanks

hazel

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default List & Text Box Problem

I'm not sure if my post give the correct answer as your query:

Private Sub Cb1_Change()
dim Tbx as textbox, i as long
for i = 6 to Lb1.ColumnCount
set Tbx = userform1.controls("Tb" & i)
Tbx.Value = Lb1.list(Cb1.listindex , i)
next i
End sub

--
Regards,

Halim



"Hazel" wrote:

Hi Halim

The Change Event sets off the debugger because at the start TB6 is empty and
it appears I will have to have many textboxes because we have so many columns
to cover on the worksheet might have to go in a different direct to get this
working properly.
--
Many thanks

hazel


"Halim" wrote:

hi,

Just guess your query:

try to use :
Private Sub Cb1_Change()
Tb6 = Lb1.list(Cb1.listindex , 6)
Tb7 = Lb1.list(Cb1.listindex , 7)
Tb8 = Lb1.list(Cb1.listindex , 8)
End sub

change Cb1.listindex to achieve your query.
--
Regards,

Halim



"Hazel" wrote:

Hi All

I select the customer from a ListBox (Lb1) all the address data etc, enters
the Text Boxes OK. the ListBox is populated via RowSource. The ComboBox (Cb1)
is populated via "Add Item" on UserForm Initialize select an item from Cb1
and Tb6 and Tb7 fill Ok and can be entered on the sheet with all the other
data.

Private Sub Cb1_Click()
Sheets("Customers").Select
Dim iRow As Long
Dim ws As Worksheet
rownum = Lb1.ListIndex
UserForm1.Tb6.Value = Lb1.List(, 5)
UserForm1.Tb7.Value = Lb1.List(, 6)

End Sub

Is it possible to select another item in Cb1 using Tb6 & Tb7 as below or
would I need multiple TextBoxes

UserForm1.Tb6.Value = Lb1.List(, 7)
UserForm1.Tb7.Value = Lb1.List(, 8)

Hope I have made my problem an easy and understandable query.


--
Many thanks

hazel

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default List & Text Box Problem

Hi Hallim

On Change Event the Userform goes in to DeBug -- On Click Event the UserForm
opens and all address data enters the textboxes as before however on making
a selection in Cb1

Private Sub Cb1_Click()

Dim Tbx As TextBox, i As Long
For i = 6 To Lb1.ColumnCount
Set Tbx = UserForm1.Controls("Tb" & i) '<<<<< Debugs on this line Runtime
Error 13 type mismatch
Tbx.Value = Lb1.List(Cb1.ListIndex, i)
Next i
End Sub

Also on Change Event debugs on same line with the same error message.
--
Many thanks

hazel


"Halim" wrote:

I'm not sure if my post give the correct answer as your query:

Private Sub Cb1_Change()
dim Tbx as textbox, i as long
for i = 6 to Lb1.ColumnCount
set Tbx = userform1.controls("Tb" & i)
Tbx.Value = Lb1.list(Cb1.listindex , i)
next i
End sub

--
Regards,

Halim



"Hazel" wrote:

Hi Halim

The Change Event sets off the debugger because at the start TB6 is empty and
it appears I will have to have many textboxes because we have so many columns
to cover on the worksheet might have to go in a different direct to get this
working properly.
--
Many thanks

hazel


"Halim" wrote:

hi,

Just guess your query:

try to use :
Private Sub Cb1_Change()
Tb6 = Lb1.list(Cb1.listindex , 6)
Tb7 = Lb1.list(Cb1.listindex , 7)
Tb8 = Lb1.list(Cb1.listindex , 8)
End sub

change Cb1.listindex to achieve your query.
--
Regards,

Halim



"Hazel" wrote:

Hi All

I select the customer from a ListBox (Lb1) all the address data etc, enters
the Text Boxes OK. the ListBox is populated via RowSource. The ComboBox (Cb1)
is populated via "Add Item" on UserForm Initialize select an item from Cb1
and Tb6 and Tb7 fill Ok and can be entered on the sheet with all the other
data.

Private Sub Cb1_Click()
Sheets("Customers").Select
Dim iRow As Long
Dim ws As Worksheet
rownum = Lb1.ListIndex
UserForm1.Tb6.Value = Lb1.List(, 5)
UserForm1.Tb7.Value = Lb1.List(, 6)

End Sub

Is it possible to select another item in Cb1 using Tb6 & Tb7 as below or
would I need multiple TextBoxes

UserForm1.Tb6.Value = Lb1.List(, 7)
UserForm1.Tb7.Value = Lb1.List(, 8)

Hope I have made my problem an easy and understandable query.


--
Many thanks

hazel



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default List & Text Box Problem

Ensure Tb is Textbox
or

Dim Tbx '''---- instead of Tbx as Textbox

--
Regards,

Halim



"Hazel" wrote:

Hi Hallim

On Change Event the Userform goes in to DeBug -- On Click Event the UserForm
opens and all address data enters the textboxes as before however on making
a selection in Cb1

Private Sub Cb1_Click()

Dim Tbx As TextBox, i As Long
For i = 6 To Lb1.ColumnCount
Set Tbx = UserForm1.Controls("Tb" & i) '<<<<< Debugs on this line Runtime
Error 13 type mismatch
Tbx.Value = Lb1.List(Cb1.ListIndex, i)
Next i
End Sub

Also on Change Event debugs on same line with the same error message.
--
Many thanks

hazel


"Halim" wrote:

I'm not sure if my post give the correct answer as your query:

Private Sub Cb1_Change()
dim Tbx as textbox, i as long
for i = 6 to Lb1.ColumnCount
set Tbx = userform1.controls("Tb" & i)
Tbx.Value = Lb1.list(Cb1.listindex , i)
next i
End sub

--
Regards,

Halim



"Hazel" wrote:

Hi Halim

The Change Event sets off the debugger because at the start TB6 is empty and
it appears I will have to have many textboxes because we have so many columns
to cover on the worksheet might have to go in a different direct to get this
working properly.
--
Many thanks

hazel


"Halim" wrote:

hi,

Just guess your query:

try to use :
Private Sub Cb1_Change()
Tb6 = Lb1.list(Cb1.listindex , 6)
Tb7 = Lb1.list(Cb1.listindex , 7)
Tb8 = Lb1.list(Cb1.listindex , 8)
End sub

change Cb1.listindex to achieve your query.
--
Regards,

Halim



"Hazel" wrote:

Hi All

I select the customer from a ListBox (Lb1) all the address data etc, enters
the Text Boxes OK. the ListBox is populated via RowSource. The ComboBox (Cb1)
is populated via "Add Item" on UserForm Initialize select an item from Cb1
and Tb6 and Tb7 fill Ok and can be entered on the sheet with all the other
data.

Private Sub Cb1_Click()
Sheets("Customers").Select
Dim iRow As Long
Dim ws As Worksheet
rownum = Lb1.ListIndex
UserForm1.Tb6.Value = Lb1.List(, 5)
UserForm1.Tb7.Value = Lb1.List(, 6)

End Sub

Is it possible to select another item in Cb1 using Tb6 & Tb7 as below or
would I need multiple TextBoxes

UserForm1.Tb6.Value = Lb1.List(, 7)
UserForm1.Tb7.Value = Lb1.List(, 8)

Hope I have made my problem an easy and understandable query.


--
Many thanks

hazel

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
Excell Dropdown List. Display alternate text than found in list. Shawnn Excel Discussion (Misc queries) 14 December 11th 08 07:43 PM
Large amount of text in cells - Problem text.xls (0/1) Patrick Excel Discussion (Misc queries) 3 May 5th 05 04:10 PM
Large amount of text in cells - Problem text.xls (1/1) Patrick Excel Discussion (Misc queries) 0 May 5th 05 01:23 PM
concetenate a single cell with a list of text in a text box into . Brian Brooks Excel Programming 1 November 11th 04 03:27 AM
Filter out one list of text in another list. Géry Duyck Excel Programming 2 September 5th 03 05:11 PM


All times are GMT +1. The time now is 12:40 PM.

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

About Us

"It's about Microsoft Excel"