M
Matt_10R via AccessMonster.com
Hello everyone
I'm a new member, but I've been lurking a while, trying to find an answer. I
have an OK understanding of VBA and I’m pretty good with the rest of Access.
Here's my problem...
I have a form (frmUserEntry) linked to a query (qryUserEntry) that is based
on my table (you quessed it: tblUserEntry) with "Prefix", "Number", "Date",
and "Suffix" set as the primary fields. I setup the table so there can be
duplicate entries in any one field, but there must be a unique combination of
all 4 fields…
A 12345 01/01/08 01
A 12345 01/01/08 02
B 12345 01/02/08 01
B 54321 01/02/08 02
C 54321 01/01/08 01
Etc…
My goal is to circumvent the unfriendly Access duplicate record message,
display a message that alerts the user that their entry is duplicate, clear
the current form of their duplicate entry after they click on OK in the
message box, and finally open the built-in Find dialog so they can search for
the existing record and edit it as needed.
I’ve been playing with Dlookup() in the BeforeUpdate form event and I can get
the process to work exactly the way I want for a single field, but I’m having
trouble applying it to all 4 fields. I’m not set on using Dlookup(),
especially if there’s a more efficient way of doing what I want.
Thanks in advance!
I'm a new member, but I've been lurking a while, trying to find an answer. I
have an OK understanding of VBA and I’m pretty good with the rest of Access.
Here's my problem...
I have a form (frmUserEntry) linked to a query (qryUserEntry) that is based
on my table (you quessed it: tblUserEntry) with "Prefix", "Number", "Date",
and "Suffix" set as the primary fields. I setup the table so there can be
duplicate entries in any one field, but there must be a unique combination of
all 4 fields…
A 12345 01/01/08 01
A 12345 01/01/08 02
B 12345 01/02/08 01
B 54321 01/02/08 02
C 54321 01/01/08 01
Etc…
My goal is to circumvent the unfriendly Access duplicate record message,
display a message that alerts the user that their entry is duplicate, clear
the current form of their duplicate entry after they click on OK in the
message box, and finally open the built-in Find dialog so they can search for
the existing record and edit it as needed.
I’ve been playing with Dlookup() in the BeforeUpdate form event and I can get
the process to work exactly the way I want for a single field, but I’m having
trouble applying it to all 4 fields. I’m not set on using Dlookup(),
especially if there’s a more efficient way of doing what I want.
Thanks in advance!