G
Guest
I have a function which I use to detrmine when an email should be sent
Dim Emp As Variant
Dim Emp_2 As Variant
Dim Stats As String
Stats = DLookup("[STATUS]", "[TEST]", "[EMAIL_STATUS]= 'To be sent'")
Emp = DLookup("[EMP_NAME]", "[TEST1]", "[Emp_name] ='Test ER'")
Emp_2 = DLookup("[EMP_NAME]", "[TEST1]", "[Emp_name] ='TEST ER2'")
the above seems ok however when i use an if statement ie
IF emp = "test ER" and Sats = "To Be Sent"
Run emailfunction
end if
however this method seems to generate emails even if the stats is not set as
"To Be Sent", Have I inadvertenly set stats as "To Be Sent" which is why it
sends emails out already?
need some pointers as to were I have gone wrong, any help would be appreciated
Cheers
Dim Emp As Variant
Dim Emp_2 As Variant
Dim Stats As String
Stats = DLookup("[STATUS]", "[TEST]", "[EMAIL_STATUS]= 'To be sent'")
Emp = DLookup("[EMP_NAME]", "[TEST1]", "[Emp_name] ='Test ER'")
Emp_2 = DLookup("[EMP_NAME]", "[TEST1]", "[Emp_name] ='TEST ER2'")
the above seems ok however when i use an if statement ie
IF emp = "test ER" and Sats = "To Be Sent"
Run emailfunction
end if
however this method seems to generate emails even if the stats is not set as
"To Be Sent", Have I inadvertenly set stats as "To Be Sent" which is why it
sends emails out already?
need some pointers as to were I have gone wrong, any help would be appreciated
Cheers