Quote:
Originally Posted by AdrianGawrys
Like I wrote in my first post - Error message is
"You entered an expression that has an invalid reference to the property Form/Report." and it comes up under line 9 of PopulateListsBoxes() function but only when condition from line 14 (If rs!Rcount >= 1 Then) of "Private Sub Calendar1_Click()" is False - meaning: there is no rota in tblRotas with date (rDate) specified by user (value of Calendar1) if condition from line 14 is met then PopulateListsBoxes doesn't fail - no error whatsoever.
Any ideas? I can't find a workaround to this problem.
Well, if you want to fire the code below when you have an existing record:
=================================================
Me.sfrmRota.Controls.Item(2).Requery 'Thats the part that errors when creating new record. I am using this for combobox( item(2) on subform ) to requery tblAvailableEmployees for new data
Why can't you do it like this:
========================
If Not Me.NewRecord then
Me.sfrmRota.Controls.Item(2).Requery
Else
' what you want program to do if you have a new record
End If