=> Subform Where parameters in OpenForm

  • Thread starter Thread starter Rhonda Fischer
  • Start date Start date
R

Rhonda Fischer

Hello,

I have a report criteria where the user may choose
to select ALL accidents or ALL dangerous occurances.

From here a form is opened. However as the continuous
form listed entries over the top of my background
borders I decided to put a subform to fit inside
the borders. And now my code doesn't work as the
WHERE clause in the OpenForm is referring to the
background form and not the sub form. So it doesn't
even look at the WHERE clause.

Do you have any suggestions.

Thank you kindly
Rhonda


=========================================================
If (chkAll) Then
If IsNull(txtDateFrom) Then 'No Date Range
If frameOptIncident = 1 Then
DoCmd.OpenForm "frmReportIncidentPerDepotAll", , , "AccDang
erousOcc = 1"
Else

DoCmd.OpenForm "frmReportIncidentPerDepotAll", , , "AccDang
erousOcc = 2"
End If
End if
End if
=========================================================
 
Rhonda,

Put the Where condition in the OpenArgs part of the OpenForm statement. Then
retrieve the OpenArgs value in the OnOpen event of the subform with Me.OpenArgs.
You'll have to have the Where statement in the OnOpen event of the subform.
 
Back
Top