I have a form (frmHourEnter) with textbox (Week_Ending) to select a date, and a command button (cmdStaffReport) to open another form (frmStaffReport) with textbox (txtDate). The Week_Ending is not related to any table, it is just a date on a form.
The first form code is:
The second form (frmStaffReport) code is:
On opening this form I get “Variable not defined” relating to frmHourEnter portion of frmHourEnter.sDate.Value.
How do I rectify this?
The first form code is:
Code:
Public sDate As Date
Private Sub Week_Ending_Exit(Cancel As Integer)
sDate = Week_Ending.Value
End Sub
Code:
Private Sub Form_Load()
txtDate.Value = frmHourEnter.sDate.Value
End Sub
How do I rectify this?