Report prompt for query

jneirinckx

Registered User.
Local time
Yesterday, 18:59
Joined
Feb 28, 2004
Messages
133
Good morning,

I have searched the posts but haven't found a solution.

I have a Course DB that was created by someone else which has three seperate yes/no fields for Winter, Spring, Fall terms.

I have created three querys to filter the data for the above three choices.

What I would like is that when we run the report it prompts the user to input a term( Winter, Spring, Fall) and then use the appropriate query based on their input.

Thanks in advance for your help.

Jerry
 
Good morning,

I have searched the posts but haven't found a solution.

I have a Course DB that was created by someone else which has three seperate yes/no fields for Winter, Spring, Fall terms.

I have created three querys to filter the data for the above three choices.

What I would like is that when we run the report it prompts the user to input a term( Winter, Spring, Fall) and then use the appropriate query based on their input.

Thanks in advance for your help.

Jerry


I have a form that asks for an input term (txtReport_Type) (from a combobox) and then I use that field in the report "OnOpen" event as the recordsource. I've tweaked it to show how that would work in your situation.

Code:
Private Sub Report_Open(Cancel As Integer)
    On Error Resume Next
    Set frm = Forms!YourFormName
    If Err.Number = 0 Then
        With frm
            If !txtReport_Type = "Winter" Then
                Me.RecordSource = "WinterQuery"
            ElseIf !txtReport_Type = "Spring" Then
                Me.RecordSource = "SpringQuery"
            ElseIf !txtReport_Type = "Fall" Then
                Me.RecordSource = "FallQuery"
                    End If
        End With
        Set frm = Nothing
    End If
 
Works like a charm :)

Thanks
 

Users who are viewing this thread

Back
Top Bottom