Link to home
Start Free TrialLog in
Avatar of adampdarcy
adampdarcy

asked on

Combobox table lookup

Hi guys.

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.

Many thx

Avatar of Manish Chhetia
Manish Chhetia
Flag of India image



Use the existing Data set

and use the combobox properties (DataSource, DisplayMember, ValueMember properties )

ASKER CERTIFIED SOLUTION
Avatar of Jeff Certain
Jeff Certain
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of adampdarcy
adampdarcy

ASKER

This I have tried with no success.

I've got two data adapters, one for each table, and have put them both in the same dataset.

The combobox simply displays nothing?
Code please? Specifically, where you create the adapters and fill the tables.
I havn't written it it in code as I've used the dataAdapter tools in the form designer