Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check for duplicate entry

Status
Not open for further replies.

hunterl

Instructor
May 7, 2003
7
US
I have a form with a combo box (socialsecurity) that links to my subform "test results". So I pick a person from the combo box and my subform show all the tests they have taken. It looks like this

SS# Test Name Score Retest(this is a check box)

What I want to do is when I go to enter a new test name, I want it to compare the SS# and Test Name and if score not null check my retest box.

The recordset for my subform is Test Results.

I've tried using Dlookup in the after update and it says it is a retest even if it's not, I am assuming because its the after update event. However, in before update, it doesn't work either. I'm not sure if because each test record has a unique ID or if i'm just going about this the wrong way. Any help would be appreciated. Thanks
 
I forgot to add the code I was trying to use

vartemp=dlookup("[socialsecurity]","test results","[socialsecurity]=forms![test results]![socialsecurity]")
vartemp=dlookup("[test]","test results","[test]=forms![test results]![test]")

if vartemp=forms![test results]![socialsecurity] and vartemp1 =forms![test results]![test] then
me.retest = true
msgbox("This is a restest")
endif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top