=> Subform Where parameters in OpenForm

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
=========================================================
 
P

PC Datasheet

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top