B
Bob V
I want to have the start date [tbDateFrom] to start from this code:
Me!tbDateFrom = DateSerial(Year(Date), Month(Date) - 1, 7)
Is this possible?.....Thanks for any Help............Bob
Private Sub cmdCalenderTo_Click()
DoCmd.Close acForm, "frmCalender"
iccCalender (Now)
If Len(Forms!frmCalender![tbDate]) = 0 Then
Exit Sub
Else
tbDateTo.value = Format(Forms!frmCalender![tbDate], "dd-mmm-yyyy")
End If
Dim nDateDiff As Integer, nSign As Integer
nDateDiff = DateDiff("d", CDate(tbDateFrom.value),
CDate(tbDateTo.value))
nSign = Sgn(nDateDiff)
Select Case Me.OpenArgs
Case "OwnerStatement"
If nSign = -1 Or nSign = 0 Then
MsgBox "Please Select Date In Proper Range.",
vbApplicationModal + vbExclamation + vbOKOnly
cmdCalenderTo.SetFocus
cbOwnerName.Enabled = False
Exit Sub
End If
cbOwnerName.Enabled = True
Case Else
If nSign = -1 Or nSign = 0 Then
MsgBox "Please Select Date In Proper Range.",
vbApplicationModal + vbExclamation + vbOKOnly
cmdCalenderTo.SetFocus
cbOwnerName.Enabled = False
Exit Sub
End If
cbOwnerName.Enabled = True
End Select
End Sub
Me!tbDateFrom = DateSerial(Year(Date), Month(Date) - 1, 7)
Is this possible?.....Thanks for any Help............Bob
Private Sub cmdCalenderTo_Click()
DoCmd.Close acForm, "frmCalender"
iccCalender (Now)
If Len(Forms!frmCalender![tbDate]) = 0 Then
Exit Sub
Else
tbDateTo.value = Format(Forms!frmCalender![tbDate], "dd-mmm-yyyy")
End If
Dim nDateDiff As Integer, nSign As Integer
nDateDiff = DateDiff("d", CDate(tbDateFrom.value),
CDate(tbDateTo.value))
nSign = Sgn(nDateDiff)
Select Case Me.OpenArgs
Case "OwnerStatement"
If nSign = -1 Or nSign = 0 Then
MsgBox "Please Select Date In Proper Range.",
vbApplicationModal + vbExclamation + vbOKOnly
cmdCalenderTo.SetFocus
cbOwnerName.Enabled = False
Exit Sub
End If
cbOwnerName.Enabled = True
Case Else
If nSign = -1 Or nSign = 0 Then
MsgBox "Please Select Date In Proper Range.",
vbApplicationModal + vbExclamation + vbOKOnly
cmdCalenderTo.SetFocus
cbOwnerName.Enabled = False
Exit Sub
End If
cbOwnerName.Enabled = True
End Select
End Sub