Steve Conklin (Developer@UltraDNT)
Developer at UltraDNT.com
Thu Sep 9 19:55:35 CDT 2004
What I have done here is, after an add new, in the lost focus of the second text box (some apps are first then last, others last then first) is to do a similar search for lastname=txbLastname AND firstname like left(firstname,1) & "*" ... If I get any records, I pop a modal form with a list box of all the matches ... User can click Cancel to continue the Add New or double-click the listbox item to go to a prior entry. This doesn't prevent duplicate Richard/Dick or Anthony/Tony, but will catch all the Steve/Steven/Stephen and James/Jim prior entries. Hth Steve -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK Sent: Thursday, September 09, 2004 7:48 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] A2K: Same Name Validation Excellent I didn't think at all of combining the fields at table level The 'overhead' should be minimal Many thanks Have a great day Darren -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stephen Bond Sent: Thursday, 9 September 2004 6:39 PM To: Access Developers discussion and problem solving Subject: RE: [AccessD] A2K: Same Name Validation Darren, I do this in one of my apps: Function DuplicateCount(fnIn, snIn) As Long Dim k As Variant, criteria as String criteria = "FirstName = '" & fnIn & "' AND LastName = '" & snIn & "'" k = Nz(DCount("*", "tblWhatever", criteria)) DuplicateCount = k End Function I cop the overhead of another index on the table. It's a multi-field index, it contains the FN field and the LN field, call it CombinedName, duplicates allowed. I think this is supposed to make it faster. If it doesn't it makes me feel better anyway <g> Stephen Bond Otatara, New Zealand > -----Original Message----- > From: Darren DICK [mailto:d.dick at uws.edu.au] > Sent: Thursday, 9 September 2004 5:14 p.m. > To: 'Access Developers discussion and problem solving' > Subject: RE: [AccessD] A2K: Same Name Validation > > > Hi Francisco > Pretty Basic > tblStudents > LastName (TEXT) > FirstName (TEXT) > > That's all I want to test. Just if there is one John SMITH and a data > entry person is entering a second one, I wanna alert them. > > I was thinking of a combined dlookup with First and Last name and if > the count was greater than zero, alert the user > > Many thanks > > Have a great day > > Darren > > > > > -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com