Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Barnsley, Yorkshire, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dynamically setting a form's recordsource

    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.

  2. #2
    Lounger
    Join Date
    Apr 2001
    Location
    Stuttgart, Germany
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dynamically setting a form's recordsource

    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.

  3. #3
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Barnsley, Yorkshire, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dynamically setting a form's recordsource

    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......

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dynamically setting a form's recordsource

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •