luis said:
This is not working for me.
Notice that the error message gives another user name that's on the table. HELP!!!!!!!!!!
This is the error i get.
"The Microsoft Jet database engine cannot find the input table or query 'Gary T.'. Make sure it exists and it's spelled correctly".
Here is the code i have.
If DCount("*", SEARCHED_BY, "[Searched-BY] = 'susanp'") > 0 Then
MsgBox " Found"
Else
MsgBox " Not Found"
End If
some information:
Where "SEARCHED_BY" = My table name
Where "[Searched-BY] = 'susanp'" = what i am searching for in the table. where Searched-BY is the column/Field name.
Help someone!!!!!!!!!!!!!
Luis,
You need quotes around the table name. Try
If DCount("*", "SEARCHED_BY", "[Searched-BY] = 'susanp'") > 0 Then
MsgBox " Found"
Else
MsgBox " Not Found"
End If
Using a variable (user_name) to hold the user name, the code would be
If DCount("*", "SEARCHED_BY", "[Searched-BY] = '" & user_name & "'") >
0 Then
MsgBox " Found"
Else
MsgBox " Not Found"
End If
HTH