format of date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having problems with the format of a date. here is my code that I use
to put into a word doc. but its not keeping the format that I have in the
table and form.

If IsNull(Forms![in-house r&d]![IRD]) Or Forms![in-house r&d]![IRD] = "" Then
prompt = MsgBox("The Issue Date has not been entered", vbOKOnly)
Else
.activedocument.Bookmarks("IRD").Select
.selection.Text = (CStr(Forms![in-house r&d]![IRD]))
.activedocument.Bookmarks.Add Name:=("IRD")
End If

It comes up and states the format is mm/dd/yyyyy, but I need it to be in
mmmm dd, yyyy. I have tried everything, but the format will not carry over
from the form. Thanks for any help.
 
Assuming IRD is a date you could try using
Format(Forms![in-house r&d]![IRD], "mmmm dd, yyyy")
instead of
CStr(Forms![in-house r&d]![IRD])

Hope this helps.
 
Andrew, thanks that helped. I was so close to having it, but was puttiing
the format code in the wrong place. Thanks again... this case is closed...LOL

Andrew Tapp said:
Assuming IRD is a date you could try using
Format(Forms![in-house r&d]![IRD], "mmmm dd, yyyy")
instead of
CStr(Forms![in-house r&d]![IRD])

Hope this helps.

chris_s_walters said:
I am having problems with the format of a date. here is my code that I use
to put into a word doc. but its not keeping the format that I have in the
table and form.

If IsNull(Forms![in-house r&d]![IRD]) Or Forms![in-house r&d]![IRD] = "" Then
prompt = MsgBox("The Issue Date has not been entered", vbOKOnly)
Else
.activedocument.Bookmarks("IRD").Select
.selection.Text = (CStr(Forms![in-house r&d]![IRD]))
.activedocument.Bookmarks.Add Name:=("IRD")
End If

It comes up and states the format is mm/dd/yyyyy, but I need it to be in
mmmm dd, yyyy. I have tried everything, but the format will not carry over
from the form. Thanks for any help.
 
Back
Top