HI all,
What in heavens name am i doing wrong with this DLookUP? I works in reverse no matter how i do it.
If the look up has one or less files, then i want it to open frmContact, If it has more then one record, I want it
to open frmSelectContactLocation.
This should not be this hard....
Code:
Private Sub CmdContact_Click()
If DLookup("[LocationID]", "[tblCompanyByLocation]", "[CompanyID]=" & [TxtCompanyID]) <= 1 Then
DoCmd.OpenForm "frmContact"
Else
If DLookup("[LocationID]", "[tblCompanyByLocation]", "[CompanyID]=" & [TxtCompanyID]) > 1 Then
DoCmd.OpenForm "frmSelectContactLocation"
End If
End If
End Sub