none
Modifying control in source form - Access Web App RRS feed

  • Question

  • In Access Web App, if I open a pop-up form say by clicking a button on a source form, how I can I modify any control values (e.g. combo box value) on the source form based on interaction with the pop-up form?  For my purposes the control values on the source form could be modified either while the pop-up is still open or even after it is closed.

    Here is why I think I need this:

    I have a table "Transactions" with a lookup field "Transaction_type" to another table "Transaction_types". Transaction_types is a hierarchy up to 4 levels deep, and it has just two fields beyond the ID: "Transaction_type_name" and "Parent_ID".

    I have just one combo box control in the "Transactions List" form linked to the Transaction_type lookup field.  When I click on the combo box, I save the current transaction ID as a variable and open a pop-up form than can navigate the Transaction_types hierarchy from the uppermost levels down and lets you select any one Transaction_type.  When I save the change in the pop-up, a data macro modifies the source Transaction's Transaction_type using the transaction ID and this works fine when I am modifying an existing transaction.

    Of course when I create a new transaction, this does not yet have an ID so I cannot figure out how to use a pop-up to navigate the hierarchy and then save the result in the new transaction's input form.  The only way seems to have the value of the control in the source form being modified by input in the pop-up, but since no macro is fired in the source form when the pop-up is closed, then I cannot see how to do this.

    Any suggestions are most welcome.

    Tuesday, March 1, 2016 12:01 PM

Answers

  • Hi Gianburrasca,

    Based on my test, we can’t set the control in source form, I suggest that you could add the button to the source form to refresh the data. (RequeryRecords)

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, March 2, 2016 7:36 AM
    Moderator

All replies

  • Hi Gianburrasca,

    Based on my test, we can’t set the control in source form, I suggest that you could add the button to the source form to refresh the data. (RequeryRecords)

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, March 2, 2016 7:36 AM
    Moderator
  • Thank you Starain, it is a pity that this is not possible. I have added the button but it is not very elegant.

    Regards,

    Giacomo

    Wednesday, March 2, 2016 8:33 AM
  • Hi V Giacomo,

    You may submit the user voice here.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, March 3, 2016 2:36 AM
    Moderator
  • Perhaps you save the record before you launch the popup form. And so what if the ID value is zero, it is when you return that you set the value anyway, right?

    Note that you CAN reference previous values and do NOT have to use a var to pass the value.

    view.[some text box on previous form]

    Will always reference values from the calling form.

    So while the 'view' trick will let you grab/use values from the previous form, I don't see why after returning from the popup form you can't simply use setproperty/value to update the selected ID from that form.

    Regards,

    Albert D. Kallal (Access MVP)

    Edmonton, Alberta Canada

    kallal@msn.com

    Thursday, March 3, 2016 8:11 PM
  • Albert, thanks for the suggestions.

    Regarding saving before opening the popup, in other cases this may work.  In my case, the popup us opening to populate a field in the middle of the source form, so that not all required fields are yet filled, meaning that trying to save would generate an exception.  I cannot change the order to make the popup field last since its value determines conditions on subsequent fields.

    Regarding use of setproperty/value after returning, that is what I cannot make happen since in Access Web App no event is triggered on the source form by the closing of the popup (no On Load or On Current) so that I have to have a button on the source form to do the setproperty/value using the value chosen in the popup (and remembered as a variable)

    I hope I have understood your suggestions correctly.

    Regards,

    Giacomo

    Friday, March 4, 2016 1:48 PM