473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to show relevant column data in Combo box?

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).

4 1802
Mihail
759 512MB
So, SG, what you are trying to do ?
What is the final goal ?
Apr 16 '12 #2
sg2808
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
Mihail
759 512MB
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
sg2808
91
Brilliant. Many thanks Mihail for the above information. That helps.
Apr 16 '12 #5

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

Similar topics

0
by: Meyer1228 | last post by:
VB6 - We have three data combo boxes with identical properties, each pointing to a different data file. We're using an odbc driver with a 4th gl indexed database. All that is working beautifully. ...
2
by: bissatch | last post by:
If I want to determine what data types a table has, how would I do this using PHP? I tried looking into SHOW TABLES but would I be correct in saying that just displays a list of tables? I want...
3
by: David M | last post by:
When using a dataset, how can one get to a column data element using this format: dataset.Tables.Rows.... I can get to a specific row, but I am not sure how to get to the column or data. I...
2
by: Agnes | last post by:
Before, I am vfp developer, the list box can show more than 1 column. Now, i don't know how to do in vb.net ? I found that it only can display one member . Thanks From agnes
0
by: adjuster11 | last post by:
Bear with me, Noob question. I'm not a programmer, but a proprietary software program, Xactimate 24 property estimate, is forcing me to be one. I've tried multiple installs of their program on a new...
0
by: Daniel | last post by:
how does ado.net SqlDataReader.GetString() know which encoding to read the data into a string as? Does sql sever set this at the column data type level, server wide encoding setting, os encoding?
2
by: bogie | last post by:
Hello I have some problem to change my column data type in my table property from character(15) to character(100). I use Postgresql 7.4. The problem is I try to make new column with...
6
chiragvithlani
by: chiragvithlani | last post by:
In SQL Server 2005... with some 11K rows I am having two tables T1 and T2(as bkup of T1), now i need one column data of T2 as i accidently updated T1 column data, (Update T1.colx with T2.colx) ...
1
by: sunilkds | last post by:
How to count total number of items in the Data Combo in Vb6.0
0
by: naveendb2dba | last post by:
while loading the PK COLUMN data into table I am getting the duplicate key in a table because of PK COLUMN having auto increment. My requirement is what ever data having the ORIGINAL TABLE that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.