undefinedundefinedundefined
I currently have a form that I use that sutomatically brings up a calendar when you enter the start date and end date fields. I would like to have the calendar open with the surrent date. At this time it opens with a December 2000 date. This is the
VB macro that it rums on:
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
Any help would be graatly appriciated. Thanks.