Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse Date in Module, update table on form save 2

Status
Not open for further replies.

taterease

MIS
Jun 19, 2003
23
US
I've a form which has a date field (format mm/dd/yyyy); in the form properties before update I want to run a code sequence which will modifiy two other fields on the form (month_date and year_date) to the proper month and year.

Thus:

date_field = 11/01/2004 would result in
month_date = NOVEMBER
year_date = 04

I've just about every variation on the code that I can come up with, basically around this:

If Me.date_field = 11/??/?? then
me.month_date = "November"

and so forth...a case statement might be better, but the real problem is that the format of "11/??/??" is giving me fits. The wildcards aren't working.

Any help on the proper syntax greatly appreciated.

Jim

 
Have you tried the Format function ?
Me!month_date = Format(Me!date_field, "mmmm")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi

You want:

"date_field = 11/01/2004 would result in
month_date = NOVEMBER
year_date = 04"

try

month_date = Format(date_field,"mmmm")
year_date = Format(date_Field,"yy")



Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top