DB Combo boxes 
Author Message
 DB Combo boxes

Hi all,

I'm trying to replicate an Access front end in a VB 5 system, and I've
having some trouble using DB combo's. They seem to work fine if you just
want to reproduce 1:M relationship, but I also have the following scenario:

I'm writing an internal bug/problem tracking system, and so a bug is
reported by a company (M:1). So far so good. Within that company then you
can have multiple users, so I want a combo box to then display only the
relevant users for that company. I'm storing the company key and the user
key in the bug table, and in the user table I'm storing the company key. In
access this is a doddle to represent, but VB seems to be making this a bit
more difficult to do, because it seems you have to bind the DB combos to a
data control. Can anyone help me with this one.

TIA

Richard



Fri, 16 Mar 2001 03:00:00 GMT  
 DB Combo boxes
Use the combo box and under form load type this.

Dim db As Database
Dim rs As RecordSet

Set db = OpenDatabase(App.Path & "\dbname.mdb")
Set rs = db.OpenRecordset("TableName")

Do While Not rs.EOF
    combo1.AddItem rs("RecordName")
    rs.MoveNext
Loop
rs.Close
db.Close

HTH,

etta

Quote:

>Hi all,

>I'm trying to replicate an Access front end in a VB 5 system, and I've
>having some trouble using DB combo's. They seem to work fine if you just
>want to reproduce 1:M relationship, but I also have the following scenario:

>I'm writing an internal bug/problem tracking system, and so a bug is
>reported by a company (M:1). So far so good. Within that company then you
>can have multiple users, so I want a combo box to then display only the
>relevant users for that company. I'm storing the company key and the user
>key in the bug table, and in the user table I'm storing the company key. In
>access this is a doddle to represent, but VB seems to be making this a bit
>more difficult to do, because it seems you have to bind the DB combos to a
>data control. Can anyone help me with this one.

>TIA

>Richard



Fri, 16 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADO, Access, DB Combo boxes

2. DB Combo boxes

3. how do i fill DB combo box using dao

4. DB Combo boxes

5. DB Combo Box

6. Db Combo Boxes

7. VB 4.0/database/db combo box

8. DB Combo box questions

9. HELP!!! DB Combo Box Control

10. DB Combo Boxes refreshing

11. DB Combo Boxes

12. How to spedup db combo box

 

 
Powered by phpBB® Forum Software