[AccessD] ComboBox Rowsource With 2 Field PK

Gustav Brock gustav at cactus.dk
Wed Sep 24 07:39:49 CDT 2003


Hi William

I agree completely but hadn't left the pragmatic level.

/gustav


> gustav

> ...personally, "William's" advice would be to add an AN PK to the damn table
> no matter what the client said and use that since there is absolutely
> nothing in the customer's "primary key" that guarantees uniqueness ...the
> query source would be a fall back only in case the client was truly an idiot
> case ...in which event I'd drop him like a hot potato anyway ...when
> client's start designing my dbs, its time to find new clients :(

> ...but that would probably start the great surrogate key debate all over
> again and then JC would have to spend a couple days and mega bw writing
> rants and you know the rest ...etc, etc, etc :))))))

> William Hindman
> So, then, to every man his chance -- to every man, regardless of his birth,
> his shining golden opportunity -- to every man his right to live, to work,
> to be himself, to become whatever his manhood and his vision can combine to
> make him -- this, seeker, is the promise of America.
> -- Thomas Wolfe



> ----- 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.



More information about the AccessD mailing list