date format

  • Thread starter Thread starter bindurajeesh
  • Start date Start date
B

bindurajeesh

I have a form that gathers a job type. If the job type is one category the
date format is mm/dd/yyyy but it is not format is m/yyyy.

Code
if type_of_job.text = "TE" then
start_date.format = "mm/dd/yyyy"
else
start_date.format = "m/yyyy"
end if

The problem is that start date is not placed into the underlying table with
the format requested. I need this format change so that my report will show
the correct formats for the correct type of jobs. I have tried to place
similar code on open event or page event on the report and it does not work.
Thanks for suggestions
 
I suspect you are confused between how data is stored and how it is
displayed. Use of .format only controls the display.

You can store date/time data in a date/time field and use formatting to
control how it appears in forms and reports.

Use your If...Then... statement on the raw data to modify the display
format.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
ok thank you. the issue is then how do I make it display on the report with
the desired format for the desired type_of_job. I have tried doing a iff in
the format section of the start_date but it does not like that. I could do
an update to the raw data but trying to find an easier fix.
 
Back
Top