combo box setup

A

ace

I have posted this question before and posting it again since I have not
received a response for my particular example below. Basically, question is
how can I setup a combo box so that the combo box2 either shows a name from a
table field or a list of names depending on the selection in combo box1.

A simple example will go a long way, and I appreciate your help.

It is a real estate application and followings are my tables;

tblResourceType
1 Seller
2 Seller Agent
3 Office Assistant
4 Virtual Assistant
5 Buyer
5 Buyer Agent

tblTransaction (this table contains all transaction information)
ID-Transaction
ID-Seller
ID-Buyer
ID-SellerAgent
ID-BuyerAgent

tblSeller
ID-Seller

tblBuyer
ID-Buyer

tblSellerAgent
ID-SellerAgent

tblBuyerAgent
ID-BuyerAgent

tblAssistant (contains Virtual Assistant, Office Assistant, etc.)
ID-Assistant

In a form, I select the Resource Type using a combo box and using the table
tblRsourceType. Correspondinly, I need to pull and display the name of the
person for a particular ID-Transaction or a list of person to select from. In
cases like buyer/seller/buyeragent/selleragent the tblTansaction table which
contains the foreign key for those four resource types. However, if Office
Assistant or Virtual Assistant is selected, I may have a list of Office
Assistant or list of Virtual Assistant to select from. So, when those are
selected I need to show the list of assistants to a user to select one from.

I appreciate any help in coding this.

Thanks,
AC
 
P

PJFry

On a very high level, you should be able to accomplish what you want with a
Select Case statment.

Select Case me.FirstComboBox
Case 1
Me.SecondComboBox.RowSource = "SELECT something FROM tSomewhere"
Case 2
ect...
End Select

The idea is to change the row source for the second combo box using the
value of the first. If the ID for a Virtual Assistant is 5, then you would
have Case 5 and the statement to query that table.

Post back with questions.
 
P

Piet Linden

I have posted this question before and posting it again since I have not
received  a response for my particular example below.  Basically, question is
how can I setup a combo box so that the combo box2 either shows a name from a
table field or a list of names depending on the selection in combo box1.

A simple example will go a long way, and I appreciate your help.

It is a real estate application and followings are my tables;

tblResourceType
1 Seller
2 Seller Agent
3 Office Assistant
4 Virtual Assistant
5 Buyer
5 Buyer Agent

tblTransaction (this table contains all transaction information)
ID-Transaction
ID-Seller
ID-Buyer
ID-SellerAgent
ID-BuyerAgent

tblSeller
ID-Seller

tblBuyer
ID-Buyer

tblSellerAgent
ID-SellerAgent

tblBuyerAgent
ID-BuyerAgent

tblAssistant (contains Virtual Assistant, Office Assistant, etc.)
ID-Assistant

In a form, I select the Resource Type using a combo box and using the table
tblRsourceType.   Correspondinly, I need to pull and display the name of the
person for a particular ID-Transaction or a list of person to select from.. In
cases like buyer/seller/buyeragent/selleragent the tblTansaction table which
contains the foreign key for those four resource types. However, if Office
Assistant or Virtual Assistant is selected, I may have a list of Office
Assistant or list of Virtual Assistant to select from. So, when those are
selected I need to show the list of assistants to a user to select one from.

I appreciate any help in coding this.

Thanks,
AC

you can set the RowSource property of the combobox in the OnChange or
AfterUpdate event of the first combobox. just specify the new source
SQL and you should be fine.
 
A

ace

Piet,
I know for someone like you who knows this stuff it looks and sound so easy!
But for me, I need to see an example. Can you create some statements using my
database example! That will help alot.

Thanks,
AC Erdal
 
A

ace

Thanks. I understand the concept. It would be great help if you can write
couple of real statements using my database example and actual names. For
example replacing "something" and "somewhere" with tables and fields I have.

Lets say I have the ID-Seller. How can I find the "Buyer" for that property.
The tblTransaction table has all the foreign key IDs, but I am not sure how
connect to the Buyer table through the tblTransaction table!

Thanks,
AC Erdal
 
A

ace

I posted a question regarding your reply but I did not get any response. Just
in case you have overlooked!

Thanks,
AC Erdal
 
A

ace

I posted a question regarding your reply but I did not get any response. Just
in case you have overlooked!

Thanks,
AC Erdal
 

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

Top