Format A Date

ddrew

seasoned user
Local time
Today, 23:13
Joined
Jan 26, 2003
Messages
911
I have a procedure to export a record to excel. One of the fields is a date field and its set at medium format i.e. dd-mm-yyyy. That is how it appears i the associated tables and form.

I want to include that date in part of the exported filename.

I created a string:
Code:
strday = Forms![frm_Profile]![frm_Detection]![TrainingDate]

But the procedure is stopping because access is looking at the date as dd/mm/yyy. I think the reason its failing is because you cant name a file with a forward slash.

Is there some way I can format the string at all?
 
What about the below:

Code:
strday = CStr(Format(Forms![frm_Profile]![frm_Detection]![TrainingDate],"DD-MM-YYYY"))
 
Many thanks
 

Users who are viewing this thread

Back
Top Bottom