Results 1 to 8 of 8
  1. #1
    Shambler2 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Location
    Perris, CA
    Posts
    11

    Display PASS or FAIL using Unbound textbox

    Hello,
    I usually can find the solution browsing online, but decided to join this forumn to get specific help.

    I created a report that shows temperatures over time. I also have a graph depicting the numbers rise over time. My question is this.

    What do I need to do to display a green "PASS" or red "FAIL" based on the readings of the temperatures. My task is to display PASS if all 10 temperature sensors read =>170 for one hour. The readings are made in 15 minute intervals.



    I have created the unbound field in design view and suspect that I need to edit the vba coding to do so correct? The report is generated by the fields Timestamp (The 15 minute intervals) and Thermal 1 to Thermal 10 for temp readings.

    So on the report printout. It will say Status: PASS somewhere below the graph to give the user a quick idea if all 10 sensors reached 170 for at least an hour at some point in the ran report.

    Quick additional information. User opens a simple form to specify Start date with time and end date. In this format 06/01/2011 11:34AM. A button is pressed to run the report from a QUERY that contains the information.

    Thank you in advance for looking into a direction for me to go.

  2. #2
    Shambler2 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Location
    Perris, CA
    Posts
    11
    Here is a screen shot of what I have displayed...But I need a PASS in Green text or FAIL in red text to display next to "Status:"

    The PASS is based on all 10 sensors reaching 170 for at least 1 hour of the time specifed by paramaters set in the form that CREATED this report.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    in terms of the database (not the chart) one should be able to establish the pass/fail status using a calculated field in a query. That's the first step.

    It isn't clear whether you seek assist at the query level or the chart/display level....or both.

  4. #4
    Shambler2 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Location
    Perris, CA
    Posts
    11
    @NTC -
    I do wish assistance with how the code should look for it to calculate the values FROM the query. I need to to say either PASS or FAIL on the report side just below the graph. But I do want the calculations to reference the query.

    The query pulls dates that the user enters into a form, and otherwise shows all the temps accordingly. So perhaps I should use some kind of FOR loop to check if all sensors reach the desired temp then another for loop to check if it was consistant over one hours time?

    Any other approach is welcomed. I get a little lost in elaborate coding. Most of my experience is copy and paste with trying to understand whats going on.

    Thanks

  5. #5
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    does your actual table layout look like what is displayed in your post; i.e. where you have 1 timestamp and then the 10 sensor values in each separate column? I ask because the table could differ and that the display is a crosstab report style...

    depending on your table structure will determine the correct calculation method.

  6. #6
    Shambler2 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Location
    Perris, CA
    Posts
    11
    @NTC
    Yes. The table is created via an import from CSV. and all columns are Number format. The timestamp column is Date/time format. Otherwise, its just reworded to look pretty for the report. As you can see I did do conditional formatting on the actual report to show red if the number did not reach my specified temp, but I also need to check over time too. Thats what the PASS or Fail part does. Thank you for inquiring about this.

  7. #7
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    in query design one can make a calculated column. It isn't clear to me what your algorithm is and there is more than one way to do it. But in general you can do something like: P1Check: iif([Sensor 1]>170,"P", "F")

    This is called an Immediate If statement. You will want to look up that method and experiment with it.

    Depending on what else you might do with the data you could consider using an integer rather than a letter in order to eventual adds or sums i.e.
    P1Check: iif([Sensor 1]>170,1, 0)

    iif method can be nested.

    Hope it helps.

  8. #8
    Shambler2 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Location
    Perris, CA
    Posts
    11
    @NTC
    You gave me an idea and I was able to specify if all sensors for a particular time have a set value to display PASS or Fail using a query, but I need now to see how to verify that PASS was for 4 stamps or one hour.

    Otherwise, back to my original post. I was hoping do figure this out with coding on the report itself linked to the unbound text box.

    If there is coding that can do this, then please specify:

    If ([Thermal 1]>= 170 AND [Thermal 2]>=170 AND ........[Thermal 10]>=170)

    AND IF (Timestamp is for 1 hour)

    textbox.forecolor = Green
    display text "PASS"

    ELSE
    textbox.forecolor = Red
    display text "FAIL"

    That is what I'm wanting how to do but in coding and to link to the unbound textbox residing on the report next to the "STATUS:" label.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 04-22-2011, 03:08 PM
  2. Replies: 2
    Last Post: 11-16-2010, 10:55 AM
  3. ODBC Call Fail - Only when totals applied
    By wvuatrrd in forum Queries
    Replies: 3
    Last Post: 11-04-2010, 12:52 PM
  4. Replies: 5
    Last Post: 09-24-2010, 05:04 PM
  5. Report control of a field display/no display
    By systems013 in forum Reports
    Replies: 5
    Last Post: 02-01-2010, 09:44 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums