Results 1 to 4 of 4
  1. #1
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151

    Storing calculation result to a control on a form

    I have a subform where the user enters multiple records. Then I have a query (1) that adds the "scores" from those records, followed by a query (2) that subtracts the total scores from 100 and stores the result to a temporary table. This part is working.



    Then on the main form, I have a button to run a macro, in which I run the 2 queries. Then have a setvalue action ( I want to store the result in the temporary table to a control on the main form). No matter how I try to do this, I get an error saying that
    "the object doesn't contain the Automation object TempTableName. You tried to run a Visual Basic procedure to set a property or method for an object. However, the component doesn't make the property or method available for Automation operations. Check the component's documentation for information on the properties and methods it makes available for Automation operations."

    Please advise. Thanks.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You can't refer directly to the table if that's what you're doing. You could use a DLookup().
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151
    Do I still use setvalue action in the macro? Would you please help me with syntax? Thanks.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If there's only one record in the table:

    DLookup("FieldName", "TableName")
    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. Storing a calculation
    By Ruegen in forum Programming
    Replies: 19
    Last Post: 08-06-2013, 06:12 PM
  2. Replies: 1
    Last Post: 01-06-2013, 01:47 PM
  3. Replies: 5
    Last Post: 06-25-2012, 02:06 PM
  4. Null Value for calculation stops whole result
    By Chelcone in forum Queries
    Replies: 11
    Last Post: 04-16-2012, 03:49 AM
  5. Replies: 3
    Last Post: 07-12-2010, 01:38 PM

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