Create Date Option

B

Bob V

At this time I have a date Calendar that selects the From and To date of my
report, is it Possible to add a control so as it would take the date back to
the start of the Previous month till Now,till keeping my Calendar, Something
along theses lines = DateSerial(Year(Date), Month(Date), -1)
Thanks for any Help...........Bob
Select Case Me.OpenArgs

Case "OwnerStatement"

Me.Caption = "Owner Statement"

tbDateFrom.value = Format("01-" & Month(Now) & "-" & Year(Now),
"dd-mmm-yyyy")
tbDateTo.value = Format(Now, "dd-mmm-yyyy")
Me.cbOwnerName.Visible = True
Me.cbOwnerName = 0
fraCreditType.Visible = False
lblCreditOnly.Visible = False
lblCreditTypeAll.Visible = False
lbOwnerName.Visible = True

fraSelectInvoice.Visible = False
 
B

Bob V

I don't believe this but I think I have solved it created a button with this
code and it works as tbdateFrom is always showing the first day of the
month, does this look alright??.....................Regards Bob
Private Sub cmdMinus1Month_Click()
Me!tbDateFrom = DateSerial(Year(Date), Month(Date) - 2, 1)
End Sub
 
R

Rick Brandt

Bob V said:
I don't believe this but I think I have solved it created a button with this
code and it works as tbdateFrom is always showing the first day of the month,
does this look alright??.....................Regards Bob
Private Sub cmdMinus1Month_Click()
Me!tbDateFrom = DateSerial(Year(Date), Month(Date) - 2, 1)
End Sub

With the " - 2 " that should give you the first of two months ago, not the first
of last month.
 

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