Filter subReport by code ?

B

Bruno Frisque

Hi,
I have a report containing a subreport.
The main report is filtered by code and I'd like to filter the sub report
(containing many records) as well.
With the code below : error message : the settings is not valid for this
property etc ...

Private Sub Report_Open(Cancel As Integer)
If CurrentProject.AllForms("ClientsActuels").IsLoaded = True Then
Debug.Print "at SubRpt open!!!: ClientsActuel IS loaded" & " with IDKey
" & Forms!clientsactuels!MyIdEventKey ' = ok !
Me.Filter = "ideventkey = " & Forms!clientsactuels!MyIdEventKey '<<< error
Syntax ??
Me.FilterOn = True
end if

Many thanks in advance to tell me what's wrong !
 

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