Yep - that solved it.
Thanks again.
Now - if you want to hang with me one step further (I might not know much -
but I do know to take coding, one step at a time).............
How should I deal with duplicates?
Duplicate Last names
Or
Duplicate Phone numbers (maybe 2 room mates used the same phone)
I am assuming instead of the search button taking me to the the form with
the persons data I would first need to go to a "continuous form" That would
list all the duplicates.
I just can't get my head around how I would code that.
Thanks very much - Again
dave
Dave,
if this form allows data entry, you need to save the data before you allow
them to open the next form.
You would check for duplicates in the before update event of the form. This
is where you can cancel the update if you find duplicates.
To check for duplicates, use a DCount on the table where you store the last
name.
If DCount("[last_name]", "TheTable", "[last_name] = """ &
me.txtSearchLastName & """") >0 then
Cancel = True
'msgbox to tell user about the problem
Else
End if
Be aware that you could have the situation where 2 different people do in
fact have the same last name.
If you do a search in the newsgroups on duplicate names, I am sure you will
find many posts - this is a common problem.
Use similar DCount code to check duplicates for the phone numbers.
Jeanette Cunningham
> Yep - that solved it.
> Thanks again.
[quoted text clipped - 113 lines]
>>>>>> Thanks in advance
>>>>>> dave
Dave - 10 Mar 2008 03:22 GMT
Thanks again Jeanette
dave
> Dave,
> if this form allows data entry, you need to save the data before you allow
[quoted text clipped - 138 lines]
>>>>>>> Thanks in advance
>>>>>>> dave