IF record exists

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hello all. To check if a record exists I would usually use the lookupDB
function. However, I now need to check if 3 things exist in the one table.

I need to check if the Team has been allocated that task on that term. How
would I do this?

Further info.
A Team will have many tasks for each term.

Tables
Team - TeamID, Team
Task - TaskID, Task
Term - TermID, Term 'dropdown box containig terms (2004 - 2005)

TeamTasks ' TeamTaskID, TeamID, TaskID, TermID
 
Use a three-item criteria expression in the DCount function:

If DCount("*", "TeamTasks", "TeamID=" & TeamID & _
" And TaskID=" & TaskID & _
" And TermID=" & TermID) > 0 Then
' a record exists in the table
Else
' a record does not exist in the table
End If
 
Back
Top