Combobox table lookup
Posted on 2006-07-14
This is a simple one but can't get it to work.
VB.net with an Access Database.
I have a customer table with a marketing ID field (type: number) and this links to a Marketing table which also has a MarketingID field (type: Autonumber) and a Marketing field. I now have a form in VB.net for entering new customers and viewing exsiting. This form did contain an oleDataAdapter with the query "SELECT * FROM Customer" and a dataset dsCustomer1 and I could enter info for the customer.
I now want to allow the user to enter where the customer heard about us via a combobox and a link to this Maketing table. This will contain "TV, radio, press ...". How do I do this.
Do I create another oleDataAdapter with the query "SELECT * FROM Marketing" and add this to a new or existing dataset. Or do I merrge this query with the existing one using JOIN or WHERE??? I've had a go and also have heard of this datarelation object I should be using which I can't remember from VB 6.