The problem I have is when I copy it into my database I get the following error-
Compile error
Sub or Function not defined.
The code is as follows, with the lines highlighted being where the problem is.
Option Compare Database
Option Explicit
Private Sub cmdPrevMo_Click()
If Me!month > 1 Then
Me!month = Me!month.Column(0) - 1
Else
Me!month = 12
Me!year = Me!year - 1
End If
Call Cal([month], [year])
End Sub
Private Sub cmdNextMo_Click()
If Me!month < 12 Then
Me!month = Me!month.Column(0) + 1
Else
Me!month = 1
Me!year = Me!year + 1
End If
Call Cal([month], [year])
End Sub
Private Sub Form_Load()
Dim i As Integer, j As Integer
Dim mycontrol As Control
Dim strYear As String, nextYear As String
Dim f As Form
Dim mynum
Set f = Forms!frmCalendar
For i = 1 To 37
Forms!frmCalendar!("Text" & i).Visible = False
Forms!frmCalendar!("Day" & i).Visible = False
Next
'Set mycontrol = Me.Year
j = 1990
strYear = j
For i = 1 To 60
nextYear = j + i
strYear = strYear & ";" & nextYear
'Me.Year.AddItem j + i
Next i
Me.year.RowSource = strYear
Me!month = Format(Now, "m")
Me!year = Format(Now, "yyyy")
Call Cal([month], [year])
End Sub
Private Sub year_AfterUpdate()
Call Cal([month], [year])
End Sub
Private Sub Close_Click()
'DoCmd.Close
'DoCmd.Quit
End Sub
Private Sub Print_Click()
'Me.Visible = False
'DoCmd.OpenReport "rptCalender", acViewPreview
DoCmd.OpenForm "frmChoose"
End Sub
error-
I really would appreciate some help with this.
Thanks.