• Dynamically setting a form’s recordsource

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Dynamically setting a form’s recordsource

    • This topic has 3 replies, 3 voices, and was last updated 24 years ago.
    Author
    Topic
    #355824

    I have a table full of telecoms. circuits. When it comes to rearrange a circuit, i have been making a temp. table, appending the record into it, and opening a form for the user to confirm the current config. before modifying it.

    That has been working fine, but now there is more than one user, and of course, the second user can’t create the temp. table when the first user is using it.

    So, in the code to create the temp. tables, i now name them according to the circuit number and time, e.g. tblTemp_100010_040501. This ensures that it works within a multi-user envirinment.

    My problem now is how to set the recordsource of the form dynamically, i.e. to open the form using the temp. table that has just been created.

    I’ve tried using Forms!frmMyForm.recordsource = tblMyTempTable before using the Docmd.openform but i get told that you can’t do this whilst the form is not open.

    Any ideas greatly appreciated.

    Viewing 0 reply threads
    Author
    Replies
    • #525574

      If you have the usual back-end/front-end construction with data on server and front-end on each workstation, you should create temp tables always local, in the front-end application, so each user has his/hers own temp data.

      • #525583

        Hi. Thank you for your prompt reply. Unfortunately this database is run from a server location as my company will not allow the logon scripts to be modified in terms of updating the front end……

        • #525588

          Open the form hidden (set the windowmode property hidden).
          Then change the rowsource.
          Refresh the form and set the visible property of the form True.
          That should do the job.

    Viewing 0 reply threads
    Reply To: Dynamically setting a form’s recordsource

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: