I'm trying to use the DOW function to determine what day of the week a date is; when I run, however, I get an error that says "Compile error: sub or function not defined". Here's the code that I'm using:

intDayofweek=DOW(txtDate.text)

dtDayofweek is DIMed as an integer

Is there something wrong with the way I've coded it? Do I have to have some resource turned on in the project for this function to work?