[AccessD] A little help, please

Drew Wutka DWUTKA at Marlow.com
Mon Mar 30 12:49:38 CDT 2009


So why not use a Union query, with the bound field being a combination
of the PK from either table, and an identifier for that table. 

SELECT PersonID & "P", Name FROM tblPersonnel

UNION SELECT VendorID & "V", Name FROM tblVendors

And when a new record is added, you just need to determine what form to
use to add a vendor or employee.  Either give the user the option or
base which form opens upon who the user is.

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Martin, Donna
M
Sent: Monday, March 30, 2009 11:32 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] A little help, please

Perhaps my entire approach is wrong.  Here's what I am trying to do:
I am trying to create a list of payees from two tables:  1)
Faculty/staff info is added by HR personnel to database1.T1; Vendors and
external people would be entered into database2.T2.  Only T2 would ever
be updated from this source.  And yes...it is a concern that both have
autonumber pk's, which I have no idea how to resolve.  FYI...a new
record would require more than just the name of the vendor (e.g., phone
#, etc).

I am using Access2007.

Thanks!  Donna

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Monday, March 30, 2009 12:16 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] A little help, please

You can IF the PK is not an autonumber type of entity, IOW IF the PK is
the value itself.  If it is an autonumber, then the two tables would
each have their own PKs which might (will eventually) collide.

Also of course the combo could be bound to a field where there is no
referential integrity, i.e. the value is just being placed into a text
field (for example).

If you are trying to accomplish the "typical" combo bound to a FK in a
table, then a UNION is dubious at best.

John W. Colby
www.ColbyConsulting.com

The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.





More information about the AccessD mailing list