I am tryuing to get email addresses out of a table based on branch number using the DLOOKUP. But every time runs, I get the "You canncelled the operation" . This usually comes about if my quotes are not correct. The valure for strMaxBranch is a number but in the talbe it is a text. I thought it was automatically converting to a number, but I still get the same error. I simply cannot see the problem.
strTo = DLookup("EmailAddressTo", "tblEmailMessages", "BR_NBR = '" & strMaxBranch & "' ")
?DLookup("EmailAddressTo", "tblEmailMessages", "BR_NBR = 79 ")