Results 1 to 3 of 3
  1. #1
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839

    Unbound control into report

    I have an unbound control (General Number format) in a form. I can run queries off this number to do calculations. When I run a report it will not show the value from the form.


    Code:
    SELECT tblBatt.BatID, qryWattsSum.SumOfTTLWatts AS TTLW, tblBatteryList.BatName, tblBatteryList.BatVolt, tblBatteryList.BatAmp, (([BatAmp]*[BattCnt])/2)-100 AS MaxBatAmp, [Amphr]-40 AS MaxBatAmpCharge, ([Batvolt]*[battcnt])/2 AS BatVoltAvail, [TTLW]/[BatVoltAvail] AS Amphr, Round(((([BatAmp]*[BattCnt])/2)-100)/([TTLW]/[BatVoltAvail]),2) AS totalhrs, Round(((([BatAmp]*[BattCnt])/2)-60)/([TTLW]/[BatVoltAvail]),2) AS totalCGRhrs, tblBatt.BattCnt, [totalCGRhrs]-[totalhrs] AS BatMinutes, [Forms]![FrmInput]![NumHrs] AS nohrs
    FROM tblBatt, tblBatteryList, qryWattsSum
    WHERE (((tblBatteryList.BatVolt)<>6) AND (((([BatAmp]*[BattCnt])/2)-100)>0) AND ((tblBatt.BattCnt)<16));
    This pulls it into the query. When the report opens nohrs is blank.


    Battery V5 (2).zip


  2. #2
    hci_jon is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Location
    Montgomery, IL
    Posts
    9
    I see that [nohrs] is populated from Forms!frmInput!NumHrs, but you are closing this form right after you open the report.

    I think you may need to leave the form open because the report may run the query multiple times. In any case, if the report is trying to access that query element, if it has to refresh the query for any reason, it will become blank if the form that is being referenced is closed. Does that make sense?

  3. #3
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Makes perfect sense.

    Thanks

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

Similar Threads

  1. DLookup in unbound control
    By Abacus1234 in forum Forms
    Replies: 5
    Last Post: 10-01-2015, 11:47 AM
  2. Formatting an Unbound Control on a Report
    By Sherrydahlmontee in forum Reports
    Replies: 4
    Last Post: 08-19-2014, 04:56 PM
  3. Update unbound control in report based on if statement
    By echomania in forum Programming
    Replies: 6
    Last Post: 11-23-2012, 11:37 PM
  4. Formatting Unbound Control
    By SltPhx in forum Forms
    Replies: 12
    Last Post: 08-17-2011, 01:49 PM
  5. Replies: 1
    Last Post: 07-11-2011, 04:35 AM

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