Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with relationship

Status
Not open for further replies.

paul123456

Technical User
Apr 29, 2002
518
US
As of now i have two tables called "client" and "Data" there are set up with a one to many with all three check boxes checked. there is only one client for each record with multiple data records.. each joined by the social. what i need is to create another table called "product" this will have two fields..one for the product number and the other for the product name.. i need this info to be attached to data becuase each data record will have a product name but im not sure how. the reason for this is becuase we will be importing about 2 million records but they don't have the product name,... only the product number so i would like it to be linked up so that in a form you will c the product name and not the number. there are 43,000 different numbers attached to names, these names and numbers won't change"? i hope i didn't confuse anyone. Thanks, PAUL

 
Table structure remains EXACLY that same as it is - no change needed.

On the FORM you make the control that is bound to the Product field into a Combo Box.

Then in the ComboBox.RowSource property you put the name of the Property table as you described above. Also
ComboBox.ColumnCount = 2
ComboBox.ColumnWidth = 0cm;
ComboBox.BoundColumn = 1

This mean that the Product Number ( in the first column ) will be bound to the control, and via the ControlSource bound to the field in the data table
However, because of the column width setting = 0 the first column, with the number in it, will be zero width ( invisible ) so the control will DISPLAY the contents of the second column - the NAME.

QED.



'ope-that-'elps.


G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
I am kinda confused by this..when i go to the combo box record source properties do i put the name of the table?
like Product ComboBox.ColumnCount = 2
ComboBox.ColumnWidth = 0cm;
ComboBox.BoundColumn = 1?

or do i put the name of the field?
Thanks, PAUL

 
Correct me if im wrong but i don't think your suggestion will work...the reason being is that on my "data" table i have a field which is called "product number" which has only numbers in it..there are about 2,000,000 record with these numbers and 43,000 different numbers that have relation to names. what i want to do is create a table called product with two fields "product name" and "product number" so that when i look in the form and see the product name and i don't see the number. is this what you were suggesting? Thanks, PAUL

 
Yes that is exactly what I'm suggesting

The Product table name goes in the ROW SOURCE

The field in the data table that contains the product number already goes in the CONTROLSOURCE

A control box DOES NOT HAVE a record source property

Only Forms and Reports have Record Source properties.


Be strict on naming the things that you use and you'll find it a lot less confusing.


'ope-that-'elps.



G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top