By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,953 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,953 IT Pros & Developers. It's quick & easy.

Print report Weekly; bi-Weekly; monthly

100+
P: 274
Hi Everyone,
I need help in one more thing. I my report that I want to print under follwoing criteria:
Weekly ---------------- Set start and end date automatically to last week
Bi-Weekly --------------Set start and end dates to last 15 days
Monthly----------------Set date to first and last day of last month
I am not using dtepicker.

I have code for monthly statement
Expand|Select|Wrap|Line Numbers
  1.    EndingDate_msk.Text = Format$(DateSerial(Year(Now), Month(Now), 0), "mm/dd/yyyy")
  2.     Dim Yr, Mnth
  3.     If Month(Now) = 1 Then
  4.         Yr = Year(Now) - 1
  5.         Mnth = 12
  6.     Else
  7.         Yr = Year(Now)
  8.         Mnth = Month(Now) - 1
  9.     End If
  10.     StartingDate_msk.Text = Format$(DateSerial(Year(EndingDate_msk.Text), Month(EndingDate_msk.Text), 1), "mm/dd/yyyy")

Can some help me in getting weekly and bi-weekly dates?
Thanks in Advance
Jan 23 '08 #1
Share this Question
Share on Google+
1 Reply


QVeen72
Expert 100+
P: 1,445
Hi,

Try This :

Ending Date Remains the same..

Weekly :
Expand|Select|Wrap|Line Numbers
  1.     Dim TDate As Date
  2.     TDate = DateAdd("d",-7,Date)
  3.     StartingDate_msk.Text = Format(TDate, "mm/dd/yyyy")
  4.  
Calculate from biweekly (-14)

Regards
Veena
Jan 23 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.