Results 1 to 3 of 3

Thread: Report problem

  1. #1
    Join Date
    Dec 2003
    Posts
    138

    Question Unanswered: Report problem

    Ok so here is what I need to do I have a table that has a gas meter name and a month and year for 12 months. The meter reading is entered under the corresponding month. In my report I want to be able to show the previous and current month readings by using a form to decide which months of data to display. I can not figure it out for the life of me. When I use forms![gas meter reading]![start] and I enter July 2007, it displays July 2007 instead of the data for July 2007. I have attached it please help!!!
    Attached Files Attached Files

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Check out the sample report system in the Data Banks in this forum. A couple of issues. You don't need to have a separate field for each month in your main table (unless you want to continuously keep modifying your queries/reports). Instead, just have 1 field called something like: MeterDate - datatype = date in your table. Then You're record Source for the report would be a query with a parameter for the date field (MeterDate) such as: Between Forms![Gas meter reading]!Start and Forms![Gas meter reading]!End.

    Again, check out the "SampleReportingSystem" in the Dbforums Code Bank to see how this is done!!
    Last edited by pkstormy; 06-15-07 at 12:25.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    So your main table might be like:

    FieldName.....DataType

    RecID...........Autonumber
    MeterName....Text (try to avoid spaces in the name)
    MNumber.........Integer (avoid reserved names such as "Number".)
    MeterDate.......Date
    MReading........Integer
    Last edited by pkstormy; 06-15-07 at 12:27.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •