Combo Box, Option Group and Check Box all in One Form (1 Viewer)

irsmalik

Registered User.
Local time
Today, 17:01
Joined
Jan 28, 2015
Messages
88
Hello Dear Friends....

I need to create a Filter Form for a series of Sales Reports... containing
Combo Box, Option Group and Check Box all in One Form including Hide / Unhide Combo Box Or Option Group Or Check Box.... requirement of Reports are:
Company Wise
Division Wise
Region Wise
Territory Wise
Product Wise
Dealer Wise

can any one help..... if any demo available...

Thanks...
irsmalik
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:01
Joined
Oct 29, 2018
Messages
21,467
One way to get help is to post a sample db with test data. If you have multiple requirements, try tackling one problem at a time. Good luck!
 

irsmalik

Registered User.
Local time
Today, 17:01
Joined
Jan 28, 2015
Messages
88
Dear Friend
Here is mdb with one form.... My requirements are very simple..... I need to Run my form Options to Run these reports.
One Table and one report is available.... they can be used to filter data as per requirement.
Thanks
irsmalik
 

Attachments

  • Reports.accdb
    2.9 MB · Views: 147

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:01
Joined
Feb 19, 2002
Messages
43,264
Are we talking about ONE report with different criteria or multiple reports?

If it is just one report with varying filters, you only need the last row of controls BUT they need to cascade so when you pick the company, the region is filtered to only the relevant regions and then the territory is filtered to the relevant territory within the region. Or if the combos are independent leave them as they are.

Use the where clause of the OpenReport method.

Code:
Dim strWHERE as String
If Me.cboCompany & "" = "" Then
Else
    strWHERE = "CompanyID = " & Me.cboCompany
End IF
If Me.cboRegion & "" = "" Then
Else
    If strWHERE & "" = "" Then
        strWHERE = "RegionID = " & Me.cboRegin
    else
        strWHERE = strWHERE & " AND RegionID = " & Me.cboRegin
    end if
End If
If cboTerritory & "" = "" Then
Else
    If strWHERE & "" = "" Then
        strWHERE = "TerritoryID = " & Me.cboTerritory
    else
        strWHERE = strWHERE & " AND TerritoryID = " & Me.cboTerritory
    end if
End If

DoCmd.OpenReport ......
 

Users who are viewing this thread

Top Bottom