Combine tables in a single form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bombus
    New Member
    • Sep 2006
    • 13

    #1

    Combine tables in a single form

    Hello.

    I have MS Access 2003 and Visual Basic 6.0.

    In the Access database and two tables tblA and tblB that have a common field fldPN (Personal Number). I use ADO connection.

    From tblA I have selected a few columns that I show in VB Form1, and a datagrid showing all rows with the same fldPN value in both tables. This works perfect, and was not to hard to code.

    However, instead of the datagrid (Or in the datagrid) I would like to show comboboxes for some of the values with a few pre decided values. I need to show from 1 to 5 rows form tblB for each row in tblA. My challenge is instead of the datagrid (or in the datagrid) to show separate text- and comboboxes, showing one line for each row in the table with corresponding value in the fldPN field. I have earlier coded this in MS Access, but are now trying to do the same in Visual Basic.

    Somebody who have some sample code?
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Hi. When you are moving to hand coding your forms like this you need to think of each combo box separately. Create a recordset for each one and populate it then close the recordset. do the same for your textboxes. If they can be filled with a single query then so much better. There is no real benefit from trying to do this all in one query. The slowest part of this kind of code is the connection object. Once this is open you can open and close recordset very quickly.

    Comment

    Working...