## 2 ComBo and Text

## 2 ComBo and Text

(OP)

Hello everybody

Merry Christmas

I am very pleased to join you in this best forum

Please if you can help me to solve this problem

In Form1 i have Combo1 and Combo2 and Text1

I want when :

I choose in combo1 the number1 and I choose in Combo2 the number1 will appear in Text1 the number "9450"

I choose in combo1 the number1 and I choose in Combo2 the number2 will appear in Text1 the number "9900"

I choose in combo1 the number1 and I choose in Combo2 the number3 will appear in Text1 the number "10350"

I choose in combo1 the number2 and I choose in Combo2 the number1 will appear in Text1 the number "83508"

I choose in combo1 the number2 and I choose in Combo2 the number2 will appear in Text1 the number "10845"

I choose in combo1 the number2 and I choose in Combo2 the number3 will appear in Text1 the number "11340"

I choose in combo1 the number3 and I choose in Combo2 the number1 will appear in Text1 the number "458796"

I choose in combo1 the number3 and I choose in Combo2 the number2 will appear in Text1 the number "254879"

I choose in combo1 the number3 and I choose in Combo2 the number3 will appear in Text1 the number "12457"

and so on with other numbers

In Combo1 i have number (1-2-2-4-5)

In Combo2 i have number (1-2-2-4-5)

I tried to do in this file attached but unfortunately it does not work

Thank you in advance for help me to solve my problem

Cordially

MADA BLACK

Merry Christmas

I am very pleased to join you in this best forum

Please if you can help me to solve this problem

In Form1 i have Combo1 and Combo2 and Text1

I want when :

I choose in combo1 the number1 and I choose in Combo2 the number1 will appear in Text1 the number "9450"

I choose in combo1 the number1 and I choose in Combo2 the number2 will appear in Text1 the number "9900"

I choose in combo1 the number1 and I choose in Combo2 the number3 will appear in Text1 the number "10350"

I choose in combo1 the number2 and I choose in Combo2 the number1 will appear in Text1 the number "83508"

I choose in combo1 the number2 and I choose in Combo2 the number2 will appear in Text1 the number "10845"

I choose in combo1 the number2 and I choose in Combo2 the number3 will appear in Text1 the number "11340"

I choose in combo1 the number3 and I choose in Combo2 the number1 will appear in Text1 the number "458796"

I choose in combo1 the number3 and I choose in Combo2 the number2 will appear in Text1 the number "254879"

I choose in combo1 the number3 and I choose in Combo2 the number3 will appear in Text1 the number "12457"

and so on with other numbers

In Combo1 i have number (1-2-2-4-5)

In Combo2 i have number (1-2-2-4-5)

I tried to do in this file attached but unfortunately it does not work

Thank you in advance for help me to solve my problem

Cordially

MADA BLACK

## RE: 2 ComBo and Text

Especially how come the second and third group of selections (which are the same) give different results?

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.## RE: 2 ComBo and Text

## RE: 2 ComBo and Text

But still – what would be the logic / math to get those numbers… ?

Unless ‘hard-coding’ the outcome is an option?

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.## RE: 2 ComBo and Text

## RE: 2 ComBo and Text

## CODE

`Option Explicit Private lookup As Collection Private Sub Combo1_Click() Text1 = lookupdata End Sub Private Sub Combo2_Click() Text1 = lookupdata End Sub Private Sub Form_Load() Dim a() As Variant Dim b() As Variant Dim lp As Long a = Array(11, 12, 13, 21, 22, 23, 31, 32, 33) b = Array(9450, 9900, 10350, 83508, 10845, 11340, 458796, 254879, 1245) Set lookup = New Collection For lp = LBound(a) To UBound(a) lookup.Add b(lp), CStr(a(lp)) Next For lp = 1 To 3 Combo1.AddItem Str(lp) Combo2.AddItem Str(lp) Next Combo1.ListIndex = 0 Combo2.ListIndex = 0 End Sub Private Function lookupdata() As Long On Error Resume Next lookupdata = lookup.Item(Trim(Combo1.Text) & Trim(Combo2.Text)) End Function`

## RE: 2 ComBo and Text

^{1}, got an answer elsewhere, and unfortunately has not had the courtesy to return here to tell us he had a solution, and so wasting our time. <sigh>^{1}e.g vbforums and help4coding## RE: 2 ComBo and Text

Skip,

_{ Just traded in my OLD subtlety... for a NUance!}## RE: 2 ComBo and Text