Kamis, 30 April 2020

Re: [MSAccessProfessionals] Getting duplicate values in combo box

Toukey,

One table is rarely enough. You should study some regarding relational databases. Your application should have a table of clients with a primary key like ClientID. The fields clientlname, clientfname, addr1, and addr2 should be in the client table and no where else in your application. Then you would use the client table as the Row Source of your combo box so there is no way there should be any duplicates.

Also Date is not a good name for a field. Is this ContactDate, BirthDate, HireDate, or what. Date is the name of a function which can cause confusion in code and queries and control sources.

Regards,
Duane


From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of toukey1 via groups.io <toukey1=yahoo.com@groups.io>
Sent: Wednesday, April 29, 2020 10:59 PM
To: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject: [MSAccessProfessionals] Getting duplicate values in combo box
 
Hi,

Haven't used Access in ages so please forgive me for all the questions.

I created a very simple database with one table and one form which contains the following fields:
clientid, clientlname, clientfname, addr1, addr2, date.

I created a combobox on clientid however I am faced with duplicate values (clientid, clientlname, clientfname, addr1, addr2) when I click the combo box to select the client.  I would like to see 1 row per client.  For new records where the client already exist, the only field that would be updated is the 'date' field. I tried using 'Select Distinct' in the Row Source but it didn't help.  

Any assistance would be greatly appreciated.

Regards
Toukey

Tidak ada komentar:

Posting Komentar