Lookup (or variant) function (revisited)

M

Monty

Wow, I don't know what happened on that last post (11 copies made), so
I'll repeat it here:

My intention is to sift through records that may contain duplicate
entries in Field1 OR Field2, but not both. The two fields combined
will form a unique 'key', so to speak. So there can be duplicate
values in Field1 and again in Field2, but not for the same record.
The comparison values come from a form not attached to a table: it's a
user entry form for adding new records to the DB.

I'm hearing a couple of things, and one of them leads me to believe I
can possibly use a DCount thusly:

intResult = DCount("[Field1]", "MyDB", "[Field1] = ' " & Me.Control1 &
" ' AND [Field2] = ' " & Me.Control2 & " ' ")

If the function returns non-zero then a record containing both of
those values exists (I hope I have that right), which is all I really
need to know. I can write error routines based on that.

Do I have that correct?
 
J

John W. Vinson

Wow, I don't know what happened on that last post (11 copies made), so
I'll repeat it here:

Some other posters using Google Groups have been having similar problems. I
replied in the other thread.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top