related table and combo box

D

Dang Tran

I have two related tables.
tblAnalyst and tblWork, they have a relationship by AnalystID
I have a form that uses a combo box and its source is from
tblAnalyst.[AnalystName]

How do I assign tblWork.[AnalystID] with the value of tblAnalyst.[AnalystID]
with its respective selected tblAnalyst.[AnalystName] from the combo box?

Thanks ahead.
 
D

Damian S

Hi Dang Tran,

Assuming your form is displaying information from tblWork, you would have
your combo box with it's control source set to AnalystID (from tblWork), and
it's record source set to something like: "select AnalystID, AnalystName from
tblAnalyst order by AnalystName"

Then set the bound column to column 1, the column count to 2 and the column
widths to 0;4 and it should work fine for you.

Hope that helps.

Damian.
 
D

Dang Tran

Thanks for your reply. It is somewhat working. I want it to assign
tblWork.[AnalystName] the selection from tblAnalyst.[AnalystName] and
tlbWork.[AnalystID] from tblAnalyst[AnalystID] from the combo selection.

The combo row source is from
select AnalystID, AnalystName from tblAnalyst order by AnalystName

Damian S said:
Hi Dang Tran,

Assuming your form is displaying information from tblWork, you would have
your combo box with it's control source set to AnalystID (from tblWork), and
it's record source set to something like: "select AnalystID, AnalystName from
tblAnalyst order by AnalystName"

Then set the bound column to column 1, the column count to 2 and the column
widths to 0;4 and it should work fine for you.

Hope that helps.

Damian.

Dang Tran said:
I have two related tables.
tblAnalyst and tblWork, they have a relationship by AnalystID
I have a form that uses a combo box and its source is from
tblAnalyst.[AnalystName]

How do I assign tblWork.[AnalystID] with the value of tblAnalyst.[AnalystID]
with its respective selected tblAnalyst.[AnalystName] from the combo box?

Thanks ahead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top