Results 1 to 13 of 13
  1. #1
    tgall is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Location
    na
    Posts
    38

    Control Source = Function; Works on one computer but not another

    For one of the fields in my MS Access 2013 form, I use a Function (=StDev([TorqueCCWlbf]) for the Control Source.
    Numbers appear in the field when I run the application on my hp computer (which I'm not particularly fond of).
    However, the field is blank when I run the application on my Asus computer (which I like).

    How do I troubleshoot this anomaly?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    check for nulls 1st,
    =StDev(NZ([TorqueCCWlbf]))

  3. #3
    tgall is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Location
    na
    Posts
    38
    Love the idea, but didn't work -- still have blanks on the ASUS machine.

  4. #4
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Maybe I'm missing something here, but StDev shouldn't work at all in that context - it is a SQL domain function, not a standard MS Access function.

    On the version that does show values, does the value of that field change as you move from one record to another?

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    SQL aggregate functions can be used in textbox in form footer section.

    So when you say 'field' do you really mean a textbox? Where is that textbox located?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    tgall is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Location
    na
    Posts
    38
    Hi! John, you are correct that StDev is an SQL function code. However, StDev is also an MS Access standard function via Expression Builder (under Expression Elements, select Functions ==> Built-In Functions).

    Yes, on the version that does show values, the value of that field changes as one moves from one record to another. But the change is not due to a table field value but rather an unbound textbox field calculating fields on a continuous form. For example:
    TEST UNIT 54321 has 20 results.
    The continuous form shows the 20 results under Detail.
    The textbox field entitled txtCalc, which appears in the Form Header, calculates (=StDev([TorqueCCWlbf]) for the 20 records.
    I can filter the 20 records to a subset of 10 records and the textbox field changes/recalculates to the 10.
    This scenario is exactly what I want the textbox field to do. I just want it to do so on both the HP machine AND the Asus machine.

    This past weekend I tested MS Access on the ASUS computer to see if MS Access is corrupted and needs to be reloaded. It's not corrupted because I can create aggregate functions in the Form Headers of other MS Access databases. In fact the code built on the ASUS computer works just fine on the HP machine.

  7. #7
    tgall is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Location
    na
    Posts
    38
    Hi! June7, I used an unbound textbox in the Form Header and as the Control Source, selected Expression Builder.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    If you click in the blank field does the value fill in?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    tgall is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Location
    na
    Posts
    38
    Hi! First, to answer "Who is John Galt?" -- we are.
    Second, in the Asus computer, clicking on the blank doesn't do much more than place the cursor in the box.

    I wondered if I needed to "turn on something" in Options, but I can't find anything that'd apply.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Do other textboxes on other forms in this db have same issue?

    Since this calc works fine on other dbs on the Asus machine, what happens if you create a new textbox on this form with the same expression? Still fail? What about a new form? Still fail? What about a new db? Still fail? What about import to a new db? Still fail?

    I don't know of anything in Options that would impact this issue.

    I have one computer that must be rebooted whenever a new version of the db is distributed, otherwise textbox calculations don't happen. How weird is that!?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Quote Originally Posted by tgall View Post
    Second, in the Asus computer, clicking on the blank doesn't do much more than place the cursor in the box.
    I've had instances where a calculated control wouldn't display on some computers, but would if you clicked in it. Sounds like you have something different going on. My workaround was to force the value into the textbox in the appropriate event.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    tgall is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Location
    na
    Posts
    38
    Hi! Wanted to get this thread closed/resolved. I got the function to work on both computers.

    The real culprit was another aggregate function. The aggregate function was supposed to count the number
    of entries in a field named Pass/Fail, which appeared in the continuous form list. The Pass/Fail field, however,
    was a function within an unbound textbox on the form itself evaluating a quantification field.

    I moved the Pass/Fail function to a field in the query backing the form. Lo and behold, all was copacetic on
    both computers.

    Why my Asus computer configuration was more sensitive -- who knows.

  13. #13
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Glad you got it sorted.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 11-25-2015, 11:04 PM
  2. Replies: 2
    Last Post: 05-28-2015, 12:12 PM
  3. Replies: 4
    Last Post: 04-30-2015, 04:55 AM
  4. Replies: 3
    Last Post: 05-03-2014, 03:26 AM
  5. Replies: 5
    Last Post: 09-18-2013, 09:15 PM

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