there are more ways...... for SQL server, it would be better to use STORED PROCEDURE....
this is universal function for all your numeric IDs in all your tables...
Function MyIDExists(InputTableName as string, InputIDName as string, InputID As Long) As Boolean
Dim myRecSet As New ADODB.Recordset
Dim myConnection As String
'Use Can use CurrentProject.connection for current opened MDB or any other connection string
myConnection = CurrentProject.Connection
'myConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
' "Data Source=c:\winnt\desktop\db1.mdb;" & _
' "User Id=admin;" & _
myRecSet.Open " SELECT TOP 1 1 FROM " & InputTableName & " WHERE " & InputIDName & " = " & InputID, myConnection, adOpenForwardOnly, adLockReadOnly
If myRecSet.EOF Then
MyIDExists = False
MyIDExists = True