I've been programming in Access for fifteen years and I've never come across this problem before.
I have a Form with a number of subforms. One of the subforms is bound to a query and when the parent form opens the subform query displays data correctly. There is a combo box and a command button on the subform header. The user is intended to be able to select a value from the combo, press the button and the subform be filtered by the value from the combo.
Dim strFilter As String
strFilter = ""
If Me.cboSearchBox.Value > 1 Then
strFilter = strFilter & "([BookingStatusID] = " & Me.cboSearchBox.Column(0) & ")"
End If
DoCmd.ApplyFilter "", strFilter
If I run this normally from within the parent form and press the Filter button I keep getting prompted "Enter Parameter Value" for the BookingStatusID. However, if I open the subform on its own (not from within the parent form), it works exactly as required. Obviously the column BookingStatusID is included in the subform's DataSource.
There's no code in the parent form that addresses the subform. Elsewhere in the application similar scenarios work exactly as expected.
Does anyone have any thoughts?
Thanks
Edward