Return last month value in a text box

brum_rich

Rich
Local time
Today, 17:02
Joined
Jan 25, 2006
Messages
16
I have used the following function to return the date of the previous Sunday in a text box when I open a form..

=Date()-Weekday(Date()-1)

In a different text box I would like return the pevious month based on the date in the text box.

For example the above function would return date 20/08/06. I would like to display JUL-06 in the second text box. Can anybody help?
 
Hello
'
The following does what you ask. Put this as the control source of your text box or use it in your code.
'
=DateSerial(Year(Date()),Month(Date())-1,1)
'
Set your format property of your text box to the below format.
'
mm- yyyy
Regards
Mark
 
Many thanks mhartman
 

Users who are viewing this thread

Back
Top Bottom