Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / May 2008

Tip: Looking for answers? Try searching our database.

Report question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zufie - 06 May 2008 16:32 GMT
I can't figure out how a report on a form (form contains two text
boxes for beginning and end dates of report) and a drop down combo box
also on the same form (that allows for selection of county) are
connected to produce a report sorted by county?

I seek, but do not find how this works.

Grateful for any ideas you may have.

Zuf
Salad - 06 May 2008 17:15 GMT
> I can't figure out how a report on a form (form contains two text
> boxes for beginning and end dates of report) and a drop down combo box
[quoted text clipped - 6 lines]
>
> Zuf

I'd add a command button to display the report.

Then I might have code similar to:
    Dim strF As String

    If Not IsNull(Me.FromDate) Then
        strF = "TableDateFld >= #" & Me.FromDate & "# And "
    Endif
    If Not IsNull(Me.To) Then
        strF = strF & _
            "TableDateFld <= #" & Me.ToDate & "# And "
    Endif
    If Not IsNull(Me.ComboBoxName) Then
        strF = strF & _
            "TableDateCntry = '" & Me.ComboBoxName & "' And "
    Endif
    'remove the 'And' at the end
    If strF <> "" THen strF Left(strF,len(strF)-5)
    Docmd.OpenReport "ReportName",,,strF

In the above example I permit records greater date, less than date or
within date range.

As far as sorting it, open report in design mode and select
View/Sorting&Grouping from the menu.

Simple
http://www.youtube.com/watch?v=mqXVghIWuws&NR=1
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.