Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2005
    Posts
    220

    Unanswered: Best Practice Advice

    I have a form that has 4 tabs. When the user enters their login info on tab1, they are then directed to the approriate tab based on their selection. Each of the tabbed pages (2, 3, 4) contain a section where the users enters some required information. The required info section is the same on tabs 2, 3, and 4. They can also enter optional info on the same page.

    Here's where I need help. I am trying to avoid having to copy the VBA code for this required section, and then make minor code changes for each tab's required section. I have noticed that when I copy all the buttons, combo boxes, etc from tab 2 to tab 3, all the controls get new names.

    Does anyone have advice on how to deal with this scenario?

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    While the controls may be on a different tab, they're still on the same form, so they have to have different names. Not knowing what you're trying to do with the code, I can't suggest a better alternative to copying the code to new controls.
    Paul

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740

    my practice (no comment on best practice)

    i don't use tab controls, so this comment may not be helpful
    in my non-tabbed world, i would use a subform to achieve a similar effect.

    depending on exactly what you are trying to achieve, the non-tabbed choice is between building a single subform and hiding/showing various controls to suit the users preference --or-- completing a prototype subform0 with all the common stuff and then copy/pasting the entire form as subform1, subform2, subform3 and tweaking 1/2/3 to suit the goal. then swapping in the appropriate subform with .sourceobject.

    maintenence-wise, the hide/show approach is probably easier, but i admit to using the copied & modified aproach 99% of the time since my subforms do not have fields/code in common (...because common stuff would be in the mother form where it belongs. No?)

    izy
    currently using SS 2008R2

  4. #4
    Join Date
    Sep 2005
    Posts
    220
    I am very new at this so please be patient. I tried to copy/paste the section of the form that I wanted repeated on 3 of the 4 tabs, but now it shows up on all tabs, even the login tab. I don't understand what happened.

    HELP!!! I'm quickly loosing what little hair I have left!

    I have attached a screenprint of the form. I want the section in the red box to be visible and active on each of the 3 Category pages.
    Attached Files Attached Files
    Last edited by ssmith001; 07-06-06 at 17:55.

Posting Permissions

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