check for identical input

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Edwin

    check for identical input

    Hi,

    I have this database wich I use for scoring (sports).

    Competitors can do as much attempts as they like. All results are
    sorted by an spreadsheet, wich also publishes the highscores on the
    intranet.

    Every attempt consists of 12 individual scores, and 1 extra score to
    fill in when there's a tight totalscore. Now i would like to see an
    popup, or a message when a new totalscore is tight with another
    totalscore from earlier in the tournament.

    Basicly i would like to be alerted when i put in a new record in which
    all fields, exept the primary key, are equal to an existing record, in
    the same table.

    Help would be appreciated very much!
    Gr.
    Edwin
  • Andy Proctor

    #2
    Re: check for identical input


    "Edwin" <edwinsdvv@hotm ail.com> wrote in message
    news:54f15405.0 407070647.5d778 ef0@posting.goo gle.com...[color=blue]
    > Hi,
    >
    > I have this database wich I use for scoring (sports).
    >
    > Competitors can do as much attempts as they like. All results are
    > sorted by an spreadsheet, wich also publishes the highscores on the
    > intranet.
    >
    > Every attempt consists of 12 individual scores, and 1 extra score to
    > fill in when there's a tight totalscore. Now i would like to see an
    > popup, or a message when a new totalscore is tight with another
    > totalscore from earlier in the tournament.
    >
    > Basicly i would like to be alerted when i put in a new record in which
    > all fields, exept the primary key, are equal to an existing record, in
    > the same table.
    >
    > Help would be appreciated very much!
    > Gr.
    > Edwin[/color]

    Hi I'm fairly new at this but may be able to help a little. I've just
    finished doing something similar

    I've used an AfterUpdate event procedure for the field in question and in
    the code ive used the DLookup function to search through the database (in
    the relevant places of course) to find a match, then pop up a message

    Somthing like:

    Private Sub fieldname_After Update()
    Dim msg, strname As String
    Dim updRecord As Byte
    strname = [fieldnamehere]

    ' You can do other matches for other fields too, this is just matching a
    single field
    strLookup = DLookup("databa sefieldname_you _want_to_match" , "table",
    "field_name ='" & strname & "'")
    If strname = strLookup Then
    msg = "Some text here" 'Note I've used a string here as my real
    message spans a couple of lines
    updRecord = MsgBox(msg, vbYesNo, "Match") ' you can use
    vbOKCancel here but i've used YesNo
    If updRecord = vbNo Then
    Cancel = True
    Exit Sub
    End If

    Do stuff here if you want to after a match is found

    End If
    End Sub


    I hope it helps. Others in here helped me a short while ago so if i can
    repay that....!

    Andy


    Comment

    Working...