Darren DICK
d.dick at uws.edu.au
Thu Sep 9 18:47:30 CDT 2004
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