From: lindavon81 on
My database is used to track circuit board shipments. The serial no. field is
set to "No Duplicates Allowed", as a way to ensure that our serial numbers
aren't duplicated for any one customer.
The problem is that we get returned circuit boards that have to go through
the same shipping process, causing the serial number to have to be re-entered
into the database. I need to be able to write a code that if the serial
number belongs to a returned product, (determined by a yes/no checkbox),
duplicates are allowed.
I figure an "If ... Then" statement would work, but I can't seem to find the
correct words to get it written right. Is there anyone that can help me? I'd
greatly appreciate it!
From: Douglas J. Steele on
No offence, but it sounds as though something's wrong with your design if
you need to do that.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"lindavon81" <lindavon81(a)discussions.microsoft.com> wrote in message
news:6653F17A-453C-45EC-AAAA-6B0258E7A3BE(a)microsoft.com...
> My database is used to track circuit board shipments. The serial no. field
> is
> set to "No Duplicates Allowed", as a way to ensure that our serial numbers
> aren't duplicated for any one customer.
> The problem is that we get returned circuit boards that have to go through
> the same shipping process, causing the serial number to have to be
> re-entered
> into the database. I need to be able to write a code that if the serial
> number belongs to a returned product, (determined by a yes/no checkbox),
> duplicates are allowed.
> I figure an "If ... Then" statement would work, but I can't seem to find
> the
> correct words to get it written right. Is there anyone that can help me?
> I'd
> greatly appreciate it!


From: lindavon81 on
I agree, this is a database that was designed by someone else, with many
tables, forms, reports and queries. The forms are loaded with command buttons
that didn't work; subforms that are then used to generate a shipping report.
I have been able to fix all of them, except for the returned product serial
number problem. Unfortunately, I have had to repair the database instead of
being able to create something from scratch.
I'm thinking that to solve it, I need to create a separate form all
together, or put an "r" in front of the serial number to avoid a dupliate
serial number. The problem I'm really having is that the original database
was able to accomplish this, and I can't figure out how. I have checked all
of the event procedures, macros (there are many of them as well), and can't
see how this was accomplished.
I appreciate that you responded!

"Douglas J. Steele" wrote:

> No offence, but it sounds as though something's wrong with your design if
> you need to do that.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "lindavon81" <lindavon81(a)discussions.microsoft.com> wrote in message
> news:6653F17A-453C-45EC-AAAA-6B0258E7A3BE(a)microsoft.com...
> > My database is used to track circuit board shipments. The serial no. field
> > is
> > set to "No Duplicates Allowed", as a way to ensure that our serial numbers
> > aren't duplicated for any one customer.
> > The problem is that we get returned circuit boards that have to go through
> > the same shipping process, causing the serial number to have to be
> > re-entered
> > into the database. I need to be able to write a code that if the serial
> > number belongs to a returned product, (determined by a yes/no checkbox),
> > duplicates are allowed.
> > I figure an "If ... Then" statement would work, but I can't seem to find
> > the
> > correct words to get it written right. Is there anyone that can help me?
> > I'd
> > greatly appreciate it!
>
>
>
From: UpRider on
How about this? Remove the 'no duplicates' requirement.
When the user enters the serial number, have the before update event of that
textbox control do a Dlookup and see if the serial number already exists. If
so, use a msgbox to verify that it is OK.
If not OK, CANCEL. If OK, proceed.

UpRider

"lindavon81" <lindavon81(a)discussions.microsoft.com> wrote in message
news:6653F17A-453C-45EC-AAAA-6B0258E7A3BE(a)microsoft.com...
> My database is used to track circuit board shipments. The serial no. field
> is
> set to "No Duplicates Allowed", as a way to ensure that our serial numbers
> aren't duplicated for any one customer.
> The problem is that we get returned circuit boards that have to go through
> the same shipping process, causing the serial number to have to be
> re-entered
> into the database. I need to be able to write a code that if the serial
> number belongs to a returned product, (determined by a yes/no checkbox),
> duplicates are allowed.
> I figure an "If ... Then" statement would work, but I can't seem to find
> the
> correct words to get it written right. Is there anyone that can help me?
> I'd
> greatly appreciate it!