Dlookup to compare two values?

Joined
May 16, 2011
Messages
1
Reaction score
0
I have a junction table that is updated through a subform. Its a signup sheet for hour blocks of time and date. I want to stop a person from signing up twice for the same hour block.

The table is tblSignup, the PK is idsignup. The two FK fields fields to examine would be idEmpTbl and idHours.

If there is a duplicate in that table it would have identical idEmpTbl value and an identical idHours value.

In case this is more clear, a sample below.

tblSignup
idSignup = 81 (PK field, autonumber)
idEmpTbl = 7053 (fk to employee table,unique number)
IdHours = 43 (fk to hour block available for signup, autonumber)

What I dont want to happen is:

idsignup = 82
idEmpTbl = 7053
idHours = 43

That would be the same person signing up for the same hour block twice. Where idEmpTbl AND idHours already exists, its okay for many instances of idEmpTbl of the same value to exists as long as it doesnt have the same idHours value.

My question is forming the Dlookup to compare the value when, I think, it hasnt yet written the idHours to the table yet because this will be in the before update event on the forms subform.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top