A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Composite primary key to other table as foreign key?



 
 
Thread Tools Display Modes
  #11  
Old May 20th, 2009, 10:52 AM posted to microsoft.public.access.tablesdbdesign
Shabra Dowson
external usenet poster
 
Posts: 1
Default Composite primary key to other table as foreign key?



"Pat Hartman" wrote:

Although you can use a multi-field unique identifier with a combo, it
requires coding. The simpler solution is to change the current composite PK
to a unique index and add an autonumber to serve as the PK. That will fix
your problem with the combo. But it does create a visual issue since the
combo will show only a single field once it is closed. One solution is to
concatenate the fields you want to show in the closed combo so that they are
all mushed together as a single field for display purposes.


Where is the best place to concatenate the fields for the closed combo
display? I could create a query that joins my two fields with a space in
between - and then they wouldn't be so mushed.
  #12  
Old May 22nd, 2009, 04:01 PM posted to microsoft.public.access.tablesdbdesign
Armen Stein
external usenet poster
 
Posts: 507
Default Composite primary key to other table as foreign key?

On Wed, 20 May 2009 02:52:03 -0700, Shabra Dowson Shabra
wrote:

Although you can use a multi-field unique identifier with a combo, it
requires coding. The simpler solution is to change the current composite PK
to a unique index and add an autonumber to serve as the PK. That will fix
your problem with the combo. But it does create a visual issue since the
combo will show only a single field once it is closed. One solution is to
concatenate the fields you want to show in the closed combo so that they are
all mushed together as a single field for display purposes.


Where is the best place to concatenate the fields for the closed combo
display? I could create a query that joins my two fields with a space in
between - and then they wouldn't be so mushed.


The query is the right place. And when I say query, it can be either
a saved query or a query string right in the row source property. The
saved query is more reusable, if this combobox appears on other forms
too.

Just concatenate the fields that you want to display in the closed
combobox, and include formatting characters too, if you like. (spaces,
hyphens, parentheses, etc.)

Armen Stein
Microsoft Access MVP
www.JStreetTech.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:50 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.