Pop-up filter for reports

rc-alex

Registered User.
Local time
Today, 17:04
Joined
Apr 29, 2011
Messages
106
Hello,

I need a pop-up dialog box which filters my reports (based on queries) based on a range of dates input by the user, or other user-input criteria. Does anyone have a link to more information about how to do this? Not sure what to search for, so having a hard time finding information.

Thank you!
 
Thanks - I'm trying to figure them out. I know how to design the form and all that, and I have a report that asks for a user-input value when you open it. I'm trying to figure out how to pass the value on to the form when you click to open it from the splash screen/main form.
 
I'm trying to figure out how to pass the value on to the form when you click to open it from the splash screen/main form.

Not completely sure I know what you want but you can do something like this:
Code:
DoCmd.OpenForm "FormNameHere", acNormal, , "[FieldNameHere] = " & Chr(34) & Me.SomeControl & Chr(34)
To open a filtered form or if you just want to go to a new record and then put in a value from the other form:
Code:
DoCmd.OpenForm "FormNameHere", acNormal, DataMode:=acFormAdd
Forms!FormNameHere.TextBoxNameHere = Me.SomeControlOnOtherForm

Or you can use the OpenArgs
Code:
Docmd.OpenForm "FormNameHere", acNormal, OpenArgs:= Me.SomeControlOnOtherForm
and then you would do this in the other form's On Load event:
Code:
If Me.OpenArgs <> vbNullString Then
   Me.SomeControlNameHere = Me.OpenArgs
End If
and if the field is supposed to be numeric we need to convert it because OpenArgs is a string
Code:
If Me.OpenArgs <> vbNullString Then
   Me.SomeControlNameHere = CDbl(Me.OpenArgs)
End If

I hope that helps.
 

Users who are viewing this thread

Back
Top Bottom