I have inherited a vacation request form. In the start and stop dates there is a macro. Right now when somebody tabs onto the start or stop date a calendar comes up for the year 2000. You can change it and select any other date you wish but I would like the calendar to pop up with the current date. I am enclosing the macro below. Is there any entry I can insert or deltete to make this happen Thank you for any assistance with this.
Option Explicit
Public sDate As String 'used to write value from calendar form to form field
Public fFlag As Boolean 'did they cancel in calendar
Sub usbStartDate()
'This is the code called by start date form field
Const sfield As String = "txtStartDate"
frmCalendar.Show
If fFlag Then 'They hit enter date button
ActiveDocument.FormFields(sfield).Result = sDate 'Enter the date
Else 'They hit cancel
MsgBox "Date selection was cancelled. Please select a date"
usbStartDate 'Keep running until date is selected
End If
End Sub
Sub usbEndDate()
'This is the code called by end date form field
Const sfield As String = "txtEndDate"
frmCalendar.Show
If fFlag Then 'They hit enter date button
ActiveDocument.FormFields(sfield).Result = sDate 'Enter the date
Else 'They hit cancel
MsgBox "Date selection was cancelled. Please select a date"
usbStartDate 'Keep running until date is selected
End If
End Sub

VB Dummy
AceJay
dragank
Gseese2
Marcos Hercules
You can place the code that I have given on the Form_Load event. You can create this by double-clicking on your form. This would bring the code editor and you can just type:
calendar1.Value = Now
' since calendar is the name of your calendar control.
cheers,
Paul June A. Domag
Marshie
But it should be somewhere in directory you installed your request form in.
Cepheus77
Sorry I took so long. The macro I am refering to is is the from & to boxes. Any assistance you can give would be greatly appreciated.
JohnsonCounty ECC < xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
< xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />
Absence Request
< xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />
Absence Information
Employee Name: Date & time of request: 11/05/2005 01:18
Employee Number: Department:
Manager:
Type of Absence Requested:
Scheduled Sick Vacation/Floating Bereavement Military
Jury Duty FMLA Other (reason)
Dates of Absence: From: Thru:
Reason for Absence:
You must submit requests for absences, other than sick leave or bereavement, thirty days prior to the first day you will be absent.
__________________________________________________________________________________
Employee Signature ______________________________________ Date: ___________________
Supervisor Signature ______________________________________ Date: ___________________
Absence Information
Scheduling Supervisor Approval
Disposition:
Schedulling Supervisor Signature______________________________________ Date: ___________________
ARMY_ATC
Kensino
Sure. Just send it to my e-mail address on my profiles...
cheers,
Paul June A. Domag
ScottM124
I cannot find any reference to Form_Load event. As I stated, I inherited this form and have absolutely no VB knowldedge. If I send you a copy can you just place the calendar1.value = now where it belongs Thank You.
mmalagelada
I appreciate the assistance but unfortunately, I have no idea of what you are talking about. I am truly a VB Dummy. Not a clue.
Zee83
Are you referring to an Excel or Word Macro If so, you can find frmCalendar in the left side of the Macro Editor (Project Explorer window) open it then click the calendar control and look at its properties to see what name it was given. Upon knowing the name double click your form to automatically create a Form_Load event. In the Form_Load Event place this code:
nameOfTheCalendarControl.Value = Now
cheers,
Paul June A. Domag
DarkByte