I have 2 db tables named "product" and "supplier", linked through the field "Supplier ID", which is an autonumeric field that's on both tables...
the supplier table has the fields: supplier ID, supplier (name of the company), etc.
whereas the product table has: part number, supplier ID, etc.
(I did this with Access 2000)
what I want to do is to add info about products, one of which is the supplier. now, on my vb6 form I put a combobox, so that the user can actually choose the supplier; and 2 data controls, one for each table.
so, there are 2 things to do with this combobox:
1) display all values of the "supplier" field (of the supplier table) so that the user views all of them and chooses one, and
2) after the user chooses the name of the supplier company from it, link the choice to the supplier ID field, so that it can be recorded on the product info.
I don't know much of VB6, so I looked into one of the examples that it has (LSTCOMBO.VBP), and adapted this code from it on my form:
Private Sub Form_Load()
Dim Entry As Variant
Do While Not Data1.Recordset.EOF
Entry = Data1.Recordset!SUPPLIER
If IsNull(Entry) Then Entry = ""
Unfortunately, when I run the form, it displays the following warning message "the object does not admit this property or method", which is error 438.
after I press Enter for numerous times, it does open the form and display all the suppliers in my supplier table.
however, error and all, this is just to display, and I haven't got a clue about how to link what the user chooses to the supplier ID field...