Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2011
    Posts
    2

    Unanswered: Help with conditions

    Hello, I'll try to keep this as simple as possible.

    I have a report that is created based on user input of a timestamp. The report displays 10 temperature sensors and their readings for each timestamp. The timestamp intervals are 15mins apart. I just want to know how to write a vba code that will check that all 10 sensors reached 170degrees for one hour .

    On the report I have added an unbound textbox, and wish to add the response to the box there. The reponse would be a GREEN "PASS" or red "FAIL"

    The report is created from a query from a single table. The table has timestamps in the first column and temp sensors in the next 10 columns. I created a column that verifies all the sensors reach temp for that particular row,but I just do not understand how to check that the temps were consistant for one hours time.

    Any help would be appreciated. I'm stuck and just going in circles.

  2. #2
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    119
    Do you want the report to be filtered to just 1 hour at a time?
    If so you could have a control on a form where you input the start date and time and then filter your query by referencing it.

    So, in the query in the time column put something like this for the criteria:

    >= forms!FORMNAME!CONTROLNAME AND <= dateadd("h",1,forms!FORMNAME!CONTROLNAME)

    Just remember to add you own form and control names.
    Regards
    JD

    Software-Matters

  3. #3
    Join Date
    Jun 2011
    Posts
    2
    The user uses a form I created to specify the date and time that they wish to view. I just would like to display a PASS or FAIL message if during that time period, all temperature sensors reached >=170 and for 1 hour.

    So if they specified 06/23/2011 15:00 to 06/23/2011 20:00 and press enter, the report pops up in Print preview and displays all the Timestamps in that window. I would like a unbound box to display PASS or FAIL if at ANY point in that specified time all sensors reached temp for a constant hour.

  4. #4
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    119
    Oh I See.
    I understand how to do this if you are always producing a report for 1 hour but your eaxmple is for 5hrs.

    Does this mean that you need the calculation to work if all temperature sensors reach >=170 for 1 hour but that hour could start and finish anywhere within the 5 hours?
    Regards
    JD

    Software-Matters

Posting Permissions

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