On my main form, I've got a date field that should update another field based on a range of dates. The field is called txtDateSubmissionPhase1 and it should look up information in the table tblStageLookup, which has these relevant columns: StageDescription and StageEndDate.
This is the DLookup code I'm using:
However, weirdly I keep getting an error - and in this error it looks like the final character (in this case the second #) is omitted from the criteria.
Can anyone here tell me why this is happening and how I can avoid it? It seems a pretty strange thing for the code to do, but I have to admit that I'm always a bit at a loss with respect to code that needs to be in string format.
This is the DLookup code I'm using:
Code:
varTest = DLookup("[StageDescription]", "tblStageLookup", "[StageEndDate] <= # " & [txtDateSubmissionPhase1] & "#")
However, weirdly I keep getting an error - and in this error it looks like the final character (in this case the second #) is omitted from the criteria.
Can anyone here tell me why this is happening and how I can avoid it? It seems a pretty strange thing for the code to do, but I have to admit that I'm always a bit at a loss with respect to code that needs to be in string format.