+ Reply to Thread
Results 1 to 9 of 9

Changing tab name on form, dependent on field in tab

  1. #1
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Changing tab name on form, dependent on field in tab

    Hello again,

    I have 5 tables. Each one contains a single entry, and the first field in that table is the date the rest of the information relates to. What I'd like to do is have one user form, divided up by 5 tabs, with each table having it's own tab. I would like the name of the tab to reflect the date field, and for it to update on it's own anytime the date field is changed.

    Is there a way to do this? I was looking for a control source, and even tried sticking a label or text box over the tab, and that's most certainly not doing it.

    Thanks for any information and assistance.
    Last edited by just_some_guy; 08-18-2010 at 10:31 PM.

  2. #2
    Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: Changing tab name on form, dependent on field in tab

    Requires VBA:


    Please Login or Register  to view this content.

    If you need me to expand on this, I can just ask.

    Hope this helps,

    Dan
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the "Star" and adding to my reputation, Thanks!

  3. #3
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Changing tab name on form, dependent on field in tab

    split_atom18

    I think I get it. I'll give it a shot and see if I can make it work, though I'm fairly new to VBA for Access, and I'm not quite sure at the moment how to attach that to the userform tab for the action. If you could expand on that, it will probably help.
    Thanks

  4. #4
    Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: Changing tab name on form, dependent on field in tab

    On the forms event tabs, click on load set it to event proceedure, put the modified code i gave you above in 5 times for the 5 tabs. That will set it up on load.

    Then go to each of the 5 fields you plan on pointing them too.
    Click after update event, enter in the same modified one as before or call the form load procedure either or.

    Hope this helps,

    Dan

  5. #5
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Changing tab name on form, dependent on field in tab

    Dan,

    Thanks for the explanation, though I'm afraid I need just a bit more help. I'm completely new to VBA in Access. Though I'm familiar with it in Excel, I find that Access works very differently in VBA.

    At any rate, I opened up the properties for the form, it says the selection type is "Tab Control." I went to the event tab but did not see an "On Load" in the list of available commands.

    I tried opening various other properties to see if I could just get one for the form itself, and did not see on load in any of the event tabs.

    Any ideas where I'm going wrong?

    Thanks for all of your time on this.

  6. #6
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Changing tab name on form, dependent on field in tab

    Dan,

    Never mind on my last post. I got it figured out. Looks to be working perfectly. For now, I'm going to go ahead and mark this as solved, but if anything else comes up on it, I may re-open.

    Thanks for all of your help!

  7. #7
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Changing tab name on form, dependent on field in tab

    Ok, reopening this because I am running into a slight problem. I've put in the code, and it changes the tab name to reflect the date. But now I cannot change the date in the form. It allows me to open the calendar next to the field, but when I select a date, it will not change. It also will not allow me to change the field by typing in it.

    In fact, It's not letting me change any of the fields for the other three items I have on there that aren't tied to anything...Ahhhh! Not good.

    I checked field properties, and it still shows as enabled. Any ideas?


    Thanks.
    Last edited by just_some_guy; 08-18-2010 at 09:05 PM.

  8. #8
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Changing tab name on form, dependent on field in tab

    Ok, last time I'll post on this thread. Next time I'll start a new one. The problem was that the linked fields were not indexed. Now that I've changed that, it's working properly again.

  9. #9
    Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: Changing tab name on form, dependent on field in tab

    LOL, I feel your pain, when you try to change one of the "Locked fields" it says across the bottom Unable to Update Recordset, or something like that. It means there is an issue with the recordsource. Usually something is wrong in relationships or a calculated field or something along those lines.

    Glad you got it fixed.

    Dan

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1