none
RELIC in Access 365 RRS feed

  • Question

  • How do I access the "CALCULATION" in a related items control, in order to do some other calculations in my application.

    All my macros are in English but the system is in Spanish does that have something to do, the name of the calculation is [Orders.Tab] the calculation it is doing is a "Sum" but it shows as "Suma" in the view (form) so I tried 

    MessageBox=[OrdersTab].[Sum] and  MessageBox=[OrdersTab].[Suma] the system will give me an error 2055 if I try MessageBox=[OrdersTab] without the calculation it wil give a blank message.

    Could someone help me.

    Saturday, January 28, 2017 8:12 PM

Answers

  • Hi,

    Check your bounded field and make sure it is number type.

     

    F2 is a number field.

    In the macro, use Message=[RelatedItemsTab].[calculation]

    Regards.

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by ArturoZ Thursday, February 2, 2017 4:28 PM
    Thursday, February 2, 2017 8:23 AM
    Moderator

All replies

  • Hi,

    Are you creating an Access Web App? What is your view type?  

    Does MessageBox=[OrdersTab].[Sum] work in English?

    Besides, I think there is no method or usage like [Sum] to show calculated value. I suggest you clarify your scenario.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 31, 2017 9:48 AM
    Moderator
  • One approach would be to call a calculation method such as a DSum

    But I would suggest that the sum first be created as a query object - so that one can test it stand alone.

    So make a query that does your sum and save it with a name.

    Then in your message implement a DLookUp of that query

    Tuesday, January 31, 2017 2:24 PM
  • I don't know if it works in English for some reason (I suspect because I am right now in Mexico) the whole Access Interface is in Spanish even if my programming language (macros and VBA) are in English, the sum is part of  a related items control when you click over the sigma you have three alternatives in spanish "Suma,Recuento & Promedio" in English "Sum, Count and Average" it is the first option under calculation.  And then it says (greyed out) "If you need to reference this calculation in an expression use "[NameOfControl].calculation".

    I don't now if I am missing a parenthesis or something else.

    I thank you very much for your time and effort.

    Tuesday, January 31, 2017 4:44 PM
  • It is not a query it is in  an WEB APP under Access in a RELIC (related items control)

    I don't know if it works in English for some reason (I suspect because I am right now in Mexico) the whole Access Interface is in Spanish even if my programming language (macros and VBA) are in English, the sum is part of  a related items control when you click over the sigma you have three alternatives in spanish "Suma,Recuento & Promedio" in English "Sum, Count and Average" it is the first option under calculation.  And then it says (greyed out) "If you need to reference this calculation in an expression use "[NameOfControl].calculation".

    I don't now if I am missing a parenthesis or something else.

    I thank you very much for your time and effort.

    Tuesday, January 31, 2017 4:45 PM
  • my apologies - I do not work in the web app version of Access - and did not recognize the RELIC term. 

    as you know one cannot deploy vba in a web app and so my input should be disregarded.

    Tuesday, January 31, 2017 5:34 PM
  • Thanks anyway.
    Tuesday, January 31, 2017 5:39 PM
  • Hi,

    Check your bounded field and make sure it is number type.

     

    F2 is a number field.

    In the macro, use Message=[RelatedItemsTab].[calculation]

    Regards.

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by ArturoZ Thursday, February 2, 2017 4:28 PM
    Thursday, February 2, 2017 8:23 AM
    Moderator
  • It works, as long as I use message=[RelatedItemsTab].[calculation], if I change the name to RelateditemsTab1 under control name and I use message = [RelateditemsTab1].[calculation] it will give an error 2055 "not a valid control reference", so if I have several tabs under one relic I dont know how can I reference to each one of them.

    Could you please help me?

    I really appreciate your advice.

    Thanks

     
    Thursday, February 2, 2017 4:41 PM
  • Hi,

    >>so if I have several tabs under one relic I dont know how can I reference to each one of them.

    Each control has its own name, we use the control name to recognize. Please check if the tab is bounded to a number type and the message box refers to an valid control.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 6, 2017 9:09 AM
    Moderator
  • Thanks for your advice, now I know why it was not working, i was trying to do a Boolean  at the ON CURRENT from the main form, and seems to be it does not exist right away. If I embed the code (macro) in any other part of the form (view) it works perfectly well with any name as long as I reference as [givenname].[calculation] (given name te  name in the control).

    I really, really appreciate your advice it helped me a lot.

     
    Wednesday, February 8, 2017 2:14 AM
  • Hi,

    I am very glad that you find the cause.

    If you have any other new issues, please feel free to post threads.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, February 8, 2017 2:31 AM
    Moderator