Trying to format a date that might be less than todays date in VB2010.

To determine what date I want I use:

Code:
dim TheDate as date
TheDate = Today.AddDays(-1)
This works and returns a value of yesterdays date in the format of m/dd/yy. I am trying to get the format of "yyyymmdd"

When ever I try to change the format:

Code:
TheDate = format(Today.AddDays(-1), "yyyymmdd")
I get an error about casting a number, the value must be less than infinity. I think yesterday should be < infinity, but I still get the error.

Any idea how subtract a day from today and put it in a different format? I see lots of examples of each component on the web, but not both at the same time.