ashgull80
02-24-2008, 07:58 AM
hi
just a small question bout this code,
Private Sub cmdNext_Click()
Dim iYear As Long
iYear = CLng(txtYear.Text)
If iYear < Year(Date) Then
iYear = iYear + 1
txtYear.Text = iYear
End If
End Sub
Private Sub cmdPrev_Click()
Dim iYear As Long
iYear = CLng(txtYear.Text)
iYear = iYear - 1
txtYear.Text = iYear
End Sub
i need to be able to go back years as far as 2006 but only forward to the current year how is that possible? as at the moment it starts on 2007 will go forward to 2008 and no further but will not go back any years.
also how can i set the text box so when the user form is opened it starts on the current year?
thanks ash
just a small question bout this code,
Private Sub cmdNext_Click()
Dim iYear As Long
iYear = CLng(txtYear.Text)
If iYear < Year(Date) Then
iYear = iYear + 1
txtYear.Text = iYear
End If
End Sub
Private Sub cmdPrev_Click()
Dim iYear As Long
iYear = CLng(txtYear.Text)
iYear = iYear - 1
txtYear.Text = iYear
End Sub
i need to be able to go back years as far as 2006 but only forward to the current year how is that possible? as at the moment it starts on 2007 will go forward to 2008 and no further but will not go back any years.
also how can i set the text box so when the user form is opened it starts on the current year?
thanks ash