Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2005
    Posts
    79

    Red face Unanswered: Use Multiple Tables Based on Switchboard Selection on one form (template)

    Hello,

    I am in need of assistance and was hoping someone could help. I have around 30 tables (different fields) in a database. A user makes a selection from the switchboard to access one of the tables (around 30).

    Is there a way and how can I programmically design one main form which will populate the right table (out of the 30) in a datasheet view based on the user's selection from the switchboard?

    Thanking you in advance.

  2. #2
    Join Date
    Nov 2005
    Posts
    79

    Unhappy Lock subform controls upon loading

    Iiiiiiiiii
    Last edited by miracleblake; 08-07-14 at 13:50. Reason: Failed to start new thread. I am unable to delete this reply and I am required to have 10 characters. I am sorry.

  3. #3
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    The easiest way would probably consist in creating 30 subforms (one for each table) and a main (parent, master...) form. You then use the SourceObject property of the subform/subreport control of the parent form to change the subform that is loaded into it.

    Note: The SourceObject property is dynamic, meaning that it can be changed by code at run-time.
    Have a nice day!

  4. #4
    Join Date
    Nov 2005
    Posts
    79
    Thank you. I will look into it.

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if you have 30 tables whch coudl conceivably be coerced into a sungle form, then that sugegsts to me the basic table design is flaky. sounds like it should be two tables
    1 defines the data type (effectivley that would have 30 rows to cater for your current 30 tables)
    1 contains the actual data + the foreign key to the data type table


    yes what you want can be done, but its not the Access way. Sinndho's suggestion is probably the smarter call.

    youd have to use an unbound form, do all the fetching, displaying, savign or deleting of data in code
    it will be a pig to maintain. will probably tak nearly as long as creating 30 forms to thoroughly develop, debug and deploy. and on top of which will be a frightmare to modofu overt time, and not just for you, but the poor sap who follows on from you
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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