Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Guest ji, please consider donating today!
      Become a Supporter    ::   Make a Contribution   
    Monthly Recurring Target: $300 :: Achieved: $95

Code Question.........

Discussion in 'Information Technology' started by Code Agent, Jul 28, 2006.

Tags:
  1. Code Agent

    Code Agent
    Expand Collapse
    Guest

    Is there a way to have code pop up a warning to tell me that I am duplicating
    something?
    ex. If I enter info in fields, "House #", "Street", "Violation", "Status",
    and at a later date enter in the exact same info, I would like it to ask me
    if I want to duplicate it. Any help would be greatly appreciated.
     
  2. Loading...

    Similar Threads Forum Date
    Introducing The Spn Code Of Forum Etiquette Announcements Feb 20, 2016
    UK Sikh 'code of silence' on sexual grooming Breaking News Sep 2, 2013
    Can a Dress Code Bar Ethnic and Religious Attire Based on Customer Preferences in the US? Questions and Answers May 3, 2011
    Pacific Code Exempts Religious Drivers (Fiji) Breaking News Feb 16, 2011
    Controversial Gurdwaras 'Breaking the Sikh Code' on Meat and Alcohol Hard Talk Dec 2, 2010

  3. Rick Wannall

    Rick Wannall
    Expand Collapse
    Guest

    If you create an index on the fields of interest, and make it a unique
    index, it would prevent the problem, although the error message is not very
    informative. If you want to do this, open the table in design view, click
    View and then Indexes. In the popup index display, go to the last blank
    line. Type a new index name, then move to the center column and put each
    field name you care about in the index.

    If you're OK with DLOOKUP etc. operations, you can have a field on your data
    entry form that is bound to an expression such as this:

    =dcount("*", "mytable", "house='" & me.txthouse & "' And Street = '" &
    Me.txtstreet & "' etc etc etc")

    Of course, replace etc etc etc with the rest of your criteria. What you
    want is that the field bound to this expression would always be 0. If after
    entering data in one of the fields the count becomes anything other than 0
    (presumably 1) you could notice that and stop your entry.

    If you're good with code behind the form, you could cause your form to check
    the field, using the AfterUpdate event of each of the controls used for the
    fields you're monitoring.

    There's a lot more you could look at, but if any of these works for your
    situation then you're good to go.
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page