Question : Using DCount for two fields?

Is it possible to check two fields using the DCount function. I want to check if a record exists in a query but match both fields. I can't seem to figure out how to make this work.

Eg, check EmployeeID and RecordNum.

I've tried the following code but got nowhere.

1:
If DCount("EmployeeID" AND "RecordNum", "qy_ListEmployeeLeave", "[Forms]![frm_Switchboard].[txtEmployee]" And "[Forms]![frm_Switchboard].[cboRoom]") > 0) Then ...


Any suggestiongs please?

Jon

Answer : Using DCount for two fields?

I think you mean
1:
If DCount("*", "qy_ListEmployeeLeave", "([Forms]![frm_Switchboard].[txtEmployee] > '') And ([Forms]![frm_Switchboard].[cboRoom]) > 0") Then ...
Random Solutions  
 
programming4us programming4us