Combo Box Problem.. I think 
Author Message
 Combo Box Problem.. I think

Could you help me(VB3 PRO)......

I have a data control, a text box and a combo box.

All I want to do is when you pick an item from the combo box
is to update the text box with a another field value from the
database(Access).

EX.
If I have a database with CompanyID and CompanyName, lets say.

Using an SQL string, I create a recordsource for the combo box
of CompanyID's.

I create a text box that will show the corresponding
CompanyName of the CompanyID the user selects from the combo
box.

What happens is that you select a CompanyID but the text box
never updates to show the corresponding CompanyName. I am
using the Combo_Change Sub to change the recordsource property
of the data control based on an SQL string which selects only
those records with the combo box CompanyID.
The CompanyID is a primary index field.

(If I were to do the same thing using Access Basic, I would
simply use the AfterUpdate Sub for the Combo Box.... What's
the equivilant in VB)

Thanks in anticipation.

Martin



Tue, 10 Nov 1998 03:00:00 GMT
 Combo Box Problem.. I think

In VB4 the DBCombo implements this easily.
In VB3, try using the ItemData properfty for each item (and some code) for
this.

-------------------------------------------------
    Gerardo Valeiras
    Dpto. Matemtica Aplicada I
    Universidad de Sevilla


-------------------------------------------------


Quote:
> Could you help me(VB3 PRO)......

> I have a data control, a text box and a combo box.

> All I want to do is when you pick an item from the combo box
> is to update the text box with a another field value from the
> database(Access).



Tue, 10 Nov 1998 03:00:00 GMT
 Combo Box Problem.. I think

Quote:

> Could you help me(VB3 PRO)......

> I have a data control, a text box and a combo box.

> All I want to do is when you pick an item from the combo box
> is to update the text box with a another field value from the
> database(Access).

> EX.
> If I have a database with CompanyID and CompanyName, lets say.

> Using an SQL string, I create a recordsource for the combo box
> of CompanyID's.

> I create a text box that will show the corresponding
> CompanyName of the CompanyID the user selects from the combo
> box.

> What happens is that you select a CompanyID but the text box
> never updates to show the corresponding CompanyName. I am
> using the Combo_Change Sub to change the recordsource property
> of the data control based on an SQL string which selects only
> those records with the combo box CompanyID.
> The CompanyID is a primary index field.

> (If I were to do the same thing using Access Basic, I would
> simply use the AfterUpdate Sub for the Combo Box.... What's
> the equivilant in VB)

> Thanks in anticipation.

> Martin

The equivilant way in VB is to use Combo1_Click Method...
This varies some depending which Style (0, 1 or 2) You have
for Combo box... Peter Larsson


Tue, 10 Nov 1998 03:00:00 GMT
 Combo Box Problem.. I think

On Fri, 24 May 1996 00:43:12 +0200, "Gerardo Valeiras"

Quote:

>In VB4 the DBCombo implements this easily.
>In VB3, try using the ItemData properfty for each item (and some code) for
>this.

I have tried that. It didn't work. It wouldn't update the rest of the
fields. Is there something I have set wrong?


Tue, 10 Nov 1998 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Populating a combo box from another combo box

2. Populate a combo box from another combo box selection

3. selecting records for 2nd combo box dependant on first combo box

4. Problems making a automatic text box when selecting in a combo box

5. Vb 4.0 Problems updating Text Boxes from Combo Box linked to Data Control

6. how add columns to a combo box in vb like access combos

7. inserting a check box/combo box in a

8. Combo Box and Text Box moving together

9. How do you update text box from combo box

10. List box /combo box usage in a DTS VB custom task

11. HELP Forms, combo boxes, text boxes

12. Help filling second box from first combo box


 
Powered by phpBB® Forum Software