date format

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
 
J

Jeff Boyce

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
 
B

bindurajeesh

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top