By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,461 Members | 1,135 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,461 IT Pros & Developers. It's quick & easy.

check for identical input

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Edwin" <ed*******@hotmail.com> wrote in message
news:54**************************@posting.google.c om...
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


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_AfterUpdate()
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("databasefieldname_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
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.