'OBTAINING USER DATE RANGE and  
'DATE MANIPULATION CODE  
  
'frmDATERANGE screen  
'Notes:  
'   Variables declared as public in Module1  
'   Public procedures can be found in Module1  
  
Private Sub Form_Load()  
  
    varSTARTDATE = Format(Date, "mm/01/yy")  
    varENDDATE = DateAdd("d", -1, DateAdd("m", 1, varSTARTDATE))  
  
    txtSTARTDATE.Text = varSTARTDATE  
    txtENDDATE.Text = varENDDATE  
  
End Sub  
  
Private Sub cmdMONTH_Click(Index As Integer)  
  
    varSTARTDATE = CDate(Trim(Str(Index)) + "/01/" + Format(Date, "yy"))  
    varENDDATE = CDate(DateAdd("d", -1, DateAdd("m", 1, varSTARTDATE)))  
  
    txtSTARTDATE.Text = varSTARTDATE 'global  
    txtENDDATE.Text = varENDDATE 'global  
  
End Sub  
  
Private Sub cmdProceed_Click()  
  
    varDR = True  
  
    varSTARTDATE = CStr(txtSTARTDATE.Text)  
    varENDDATE = CStr(txtENDDATE.Text)  
  
    varPROCEED = True  
    varCANCEL = False  
  
    Me.Hide  
  
End Sub  
  
Private Sub cmdCancel_Click()  
  
    varDR = False  
    varPROCEED = False  
    varCANCEL = True  
  
    Unload Me  
  
End Sub  