Assigning Path

  • Thread starter Steven Britton via AccessMonster.com
  • Start date
S

Steven Britton via AccessMonster.com

I want to assign the path and file name using other controls I set during
the execution of code. This however doesn't currently work.

myDate = Format(Date, "mm-dd-yy")
mySource = strYear & " " & strPlant & " ALL MODELS"

strPath = "\\arlfs03\shared\Engineering\ENG\BOM Archive\BOM Reports\" &
myDate & ".xls

My path doesn't get set and I do not get an export. If I change it to:

myDate = Format(Date, "mm-dd-yy")
mySource = strYear & " " & strPlant & " ALL MODELS"

strPath = "\\arlfs03\shared\Engineering\ENG\BOM Archive\BOM Reports\2005 AB
ALL MODELS.xls

I get a file, how do I include the myDate and mySource as the file name?
 
W

Wayne Morgan

What data type did you Dim myDate as? If you didn't Dim it, then it is a
Variant data type and Access may be trying to help by making it a Date data
type since you are assigning a date to it.

Dim myDate As String
 
S

Steven Britton via AccessMonster.com

I had the myDate Dimmed - as a Date

Changed it to a String and now, huh, it works...

Thanks Again.
 
Top