Calendar Month

josros60

Well-known Member
Joined
Jun 27, 2010
Messages
780
Office Version
  1. 365
i Have form with 2 text boxes, one beginning date the other end date.
have button call month when i click should set starint and ending date of month, but it only does
January to February.

here it's the code:

Code:
Private Sub cmdmonth_Click()
'Sets the Date From and Date To text boxes
'to show complete month (from start to end of current month)
    Me!BeginDate = CDate("01/" & month(Date) & "/" & year(Date))
    Me!EndDate = DateAdd("d", -1, DateAdd("m", 1, Me!BeginDate))
End Sub

thank you
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Are you using an American or Euorpean version of Access?
Sometimes, the different order of date format ("mm/dd/yyyy" versus "dd/mm/yyyy") can cause things to behave a little different than you expect, if you have not properly coded for it.
 
Upvote 0

Forum statistics

Threads
1,215,061
Messages
6,122,922
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top