By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,121 Members | 1,723 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,121 IT Pros & Developers. It's quick & easy.

How to show relevant column data in Combo box?

P: 91
Hi,

I guess this should be easy but I do not know how to solve it.

I have two tables and its fields:

Table [Functions]
FunctionID - PK
FunctionName

Table[HLProcess]
HLProcessID - PK
FunctionID - FK
HLProcessName

The tables are linked as one to many, [Function]1:M[HLProcess]

I have created a form for Table - [HLProcess].

Step A - In this form, I then changed the field [FunctionID] to a combo box from text box so that I can pick up the [FunctionName] from table [Functions] and save it in the field [FunctionID] in table [HLProcess].
For the a above, I am using the property sheet and saved the query to get the drop down for Function field.

The problem I am facing is that I am only able to see the [FunctoinID] number in the form instead of the [FunctionName].

Step B - So, what I then do is, delete the FunctionID field which is created during the creation of the Form. I then create a combo box (with the wizard tool on) and then able to see the [FunctionName] field in the drop down in the form.

So, I am not sure what else I have to do in Step A itself when I am changing the text box to a combo box in the form to see the [FunctionName] in the dropdown?

Thanks in advance.

SG
Apr 15 '12 #1

✓ answered by Mihail

Maybe my English is not enough to understand you.
But...
1) why you do not use a form (frmFunctions) and, in this form, a subform (sbfHLProcess) ?

2) Or:
Create 2 continous forms: frmFunctions and frmHLProcess.
Then, from frmFunctions open frmHLProcess using a filter to show only the records from the current FunctionID.

3) Or:
Create a single form frmHLProcess and, in this form a combo box with row sources a query on table Functions. Then use the Filter feature.

Maybe is other thing you don't know:
A combo box control has a property named Columns Count. Setting this property to a number greater than 1 will allow you to see more columns.
Also this control has a property Bound Column. Is 0 (zero) by default: that means that, when you select something in combo box, the value for combo box will become equal with what you have in the first column (the columns numbers start with zero).
Also you can set the columns visibilities: something like this: 0;2;4 means that first column is not visible, the second column is 2cm large and the 3th is 4cm large.

Let me know if you can use that.
If not I'll prepare for you a database where to show you points 1) 2) and 3).

Share this Question
Share on Google+
4 Replies


100+
P: 759
So, SG, what you are trying to do ?
What is the final goal ?
Apr 16 '12 #2

P: 91
Hi Mihail,

This is I guess is a basic way to link the two tables. A user can do this easily by selecting the [FunctionName] instead of the [FunctionID].

As described here, the final goal in this case is to able to see the data I want to see [FunctionName] instead of the [FunctionID] in the ComboBox and thus enable the user to link the two tables using the Form easily.

As mentioned, I am able to do this in 2 steps. I am wondering if I can do this in 1 step.

Best regards,
SG.
Apr 16 '12 #3

100+
P: 759
Maybe my English is not enough to understand you.
But...
1) why you do not use a form (frmFunctions) and, in this form, a subform (sbfHLProcess) ?

2) Or:
Create 2 continous forms: frmFunctions and frmHLProcess.
Then, from frmFunctions open frmHLProcess using a filter to show only the records from the current FunctionID.

3) Or:
Create a single form frmHLProcess and, in this form a combo box with row sources a query on table Functions. Then use the Filter feature.

Maybe is other thing you don't know:
A combo box control has a property named Columns Count. Setting this property to a number greater than 1 will allow you to see more columns.
Also this control has a property Bound Column. Is 0 (zero) by default: that means that, when you select something in combo box, the value for combo box will become equal with what you have in the first column (the columns numbers start with zero).
Also you can set the columns visibilities: something like this: 0;2;4 means that first column is not visible, the second column is 2cm large and the 3th is 4cm large.

Let me know if you can use that.
If not I'll prepare for you a database where to show you points 1) 2) and 3).
Apr 16 '12 #4

P: 91
Brilliant. Many thanks Mihail for the above information. That helps.
Apr 16 '12 #5

Post your reply

Sign in to post your reply or Sign up for a free account.