Place actual selection name in table instead of ID #?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a CBO that places the companies ID in my table instead of the actual
companys name. I know this is how it is suppose to work but I need it to
place the actual name that the user selects into the table. How is this done
I know of a way?
 
In that case you have to change the field in the designated table because
initally you would store a number and now you want to store text. So change
the field to text and then change the bound column of the CBO to 2 (which is
probably the field which shows the name). This way you can still use the
combo but it will store the name in the table (as you stated this is not the
way tou use it so think about this if this is really what you want to do).

hth
 
TKM said:
I have a CBO that places the companies ID in my table instead of the actual
companys name. I know this is how it is suppose to work but I need it to
place the actual name that the user selects into the table. How is this done
I know of a way?


Before you proceed with this, you really should reexamine
why you think you need to do it. I can't think of a good
reason to ruin your table structure and strongly recommend
against it.

You can always use a query to pick up the name whenever you
want to display or export it. So, why do you want to
denormalize a perfectly good table?
 
I know I know this is not the way to go. However my Boss says do it for now
until we replace it in three motnhs. It is long and involved to chage it etc.
I have been told to do it so I am asking for help. I know it can be done
failry easy but cant remember how.
 
I know I know this is not the way to go. However my Boss says
do it for now until we replace it in three motnhs. It is long
and involved to chage it etc. I have been told to do it so I
am asking for help. I know it can be done failry easy but cant
remember how.

Tell your boss it'll take 4 months... to change all the
relationships, queries, forms, reports and code that use the
table.

Marshall Barton said:
Before you proceed with this, you really should reexamine
why you think you need to do it. I can't think of a good
reason to ruin your table structure and strongly recommend
against it.

You can always use a query to pick up the name whenever you
want to display or export it. So, why do you want to
denormalize a perfectly good table?
 
If your boss were competent in database design, s/he would
not suggest such a thing. Since s/he is not competent with
databases, s/he should leave it to someone that is competent
to determine HOW things should be done. If s/he is looking
directly at the table and wants to see the name, provide a
query for that kind of viewing.

SELECT table.fa, table.fb, table.fc, . . .
Companies.CompanyName
FROM table INNER JOIN Companies
ON table.companyID = Companies.ID

IMO that's also a waste of time because the best way to view
your data is by using the form you already have that
displays the company name in the combo box.

If your boss is a total micro manager that can't stay out of
the way, use the combo box's AfterUpdate event to set the
new CompanyName field to the name selected in the combo box:
Me.CompanyName = Me.combobox.Column(1)

If s/he want to destroy the relationship altogether, then
just set the combo box's BoundColumn property to 2 and
delete the CompanyID field from your table.

Note that I would not frown on all this if the company name
were a valid natural primary key. Names are usually not a
particularly good choice for a primary key, but your
situation may allow it.
 
Back
Top