Report question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zufie

    Report question

    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

    #2
    Re: Report question

    zufie wrote:
    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
    >
    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.FromD ate) Then
    strF = "TableDateF ld >= #" & Me.FromDate & "# And "
    Endif
    If Not IsNull(Me.To) Then
    strF = strF & _
    "TableDateF ld <= #" & Me.ToDate & "# And "
    Endif
    If Not IsNull(Me.Combo BoxName) Then
    strF = strF & _
    "TableDateC ntry = '" & Me.ComboBoxName & "' And "
    Endif
    'remove the 'And' at the end
    If strF <"" THen strF Left(strF,len(s trF)-5)
    Docmd.OpenRepor t "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&Groupin g from the menu.

    Simple

    Comment

    Working...