[AccessD] ComboBox Rowsource With 2 Field PK

Michael R Mattys michael.mattys at adelphia.net
Wed Sep 24 10:45:47 CDT 2003


Heh,

My client is a bit smarter than this.
If he wasn't a CEO, he could be a programmer.

I asked him about it this morning and he pointed
out a field where he had already concatenated the
DivisionNo and CustomerNo to assure uniqueness
as this table is updated daily from MAS-90.

I just didn't see it.

Thanks again,

Michael R. Mattys
www.mattysconsulting.com



----- Original Message -----
From: "Gustav Brock" <gustav at cactus.dk>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
Sent: Wednesday, September 24, 2003 4:38 AM
Subject: Re: [AccessD] ComboBox Rowsource With 2 Field PK


> Hi Michael
>
> This requires, of course, that you _never_ (the dangerous word) will
> have a CustomerName represented twice or more in the table ...
>
> Personally, as you do have a unique key, I would follow the advice of
> William.
>
> /gustav
>
>
> > Thanks for your reply Stuart & William
>
> > Strangely enough, neither text field requires a value
> > and can be a zero-length string.
>
> > I was able to set the bound column to 2 and
> > set the column widths to 0;0;1.
>
> > Mike Mattys
>
>
> > ----- Original Message -----
> > From: "Stuart McLachlan" <stuart at lexacorp.com.pg>
> > To: "Access Developers discussion and problem solving"
> > <accessd at databaseadvisors.com>
> > Sent: Tuesday, September 23, 2003 9:38 PM
> > Subject: Re: [AccessD] ComboBox Rowsource With 2 Field PK
>
>
> >> On 23 Sep 2003 at 21:23, Michael R Mattys wrote:
> >>
> >> > Hi Access-D,
> >> >
> >> > I have a table which cannot be edited per client
> >> > instruction. It is linked into the current database
> >> > as the customer table and has two text fields that
> >> > comprise the primary key (Division and CustomerNo)
> >> >
> >> > A third field, CustomerName, is the one I would like
> >> > to show in my combobox on my form in order to
> >> > select a customer. I cannot, however, make one
> >> > or the other the bound column as the customer name
> >> > just disappears.
> >> >
> >> > I have tried Bound Column: 1,2 and 1;2.
> >> > Doesn't work.
> >> > Does anyone know what I must do?
> >> >
> >> > Mike Mattys
> >> >
> >> >
> >>
> >> You can only bind to a single column.
> >>
> >> Preferably, redesign the customer table and related tables so that
> >> you key on a single field (see the archives for discussions on
> >> natural v surrogate keys)
> >>
> >> Alternatively, you *could*  make the combobox unbound and set the key
> >> fields in a before_update.
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com



More information about the AccessD mailing list