Full Version: Changing Design Time Properties During Runtime
UtterAccess Forums > Microsoft® Access > Access Forms
I've ran into an issue in our application where I need to be able to open the same form (and its subform) sometimes as Popup=True and other times as Popup=False. This is up to user preference but the complication is that they may want to open the form once right now as an additional tab (popup = false) but then open it again a few seconds later as popup=true. The reason for this is that they'd like to be able to compare/copy some data.
There are a couple things I could do here. I could have two instances of the form, on as Popup=true and the other as Popup=False. This is probably the route I'll be forced to take but there are some reasons why I'd prefer just to have one form.
So here's my questions:
1) What is the general theory or concept that you have to use in order to change a design-time property during runtime? I'm guessing you have to use VBA to open the object in design view (hidden?), make the required change, and then save and close the object before opening it in the normal mode/view. Is this correct? Any code examples?
2) Does it work to change design-time properties during runtime in the runtime version of MS Access?
BTW, opening the form in dialog mode is not an option because that causes the form to be modal.
Guess I've answered most of my own questions.
) The popup property definitely cannot be changed during runtime.
2) I'm posting code below to change design-time properties during runtime. I cannot confirm it, but I highly doubt that this will work in a runtime version of Access.
3) Opening a form in design mode, as shown below, kills all open/running instances of the form.

        DoCmd.OpenForm "frmMyFormName", acDesign
        With Forms("frmMyFormName")
            .PopUp = True
        End With
        DoCmd.Close acForm, "frmMyFormName", acSaveYes
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.