Consulting

Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 21 to 40 of 49

Thread: Solved: Setting using Personal workbook to store settings

  1. #21
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    Ken,

    It is working great but now I am trying to use the settings to not show a user form if the user never wants to. Here is the code I have tested:

    [VBA]If GetSetting("Business Reporting Today", "DetailTab", "Dont Show") = True Then
    Organize.Hide
    End If[/VBA]

    This would be great if I can get this to work

  2. #22
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    You can set the frame tag value using the option buttons, then you just have one value to check. You can also set the initial optionbutton values based on a fixed or retrieved value. eg
    [VBA]Private Sub UserForm_Initialize()
    x = 3
    Me.Controls("OptionButton" & x) = True
    End Sub

    Private Sub CommandButton1_Click()
    MsgBox Frame1.Tag
    End Sub

    Private Sub OptionButton1_Click()
    If OptionButton1 Then Frame1.Tag = 1
    End Sub
    Private Sub OptionButton2_Click()
    If OptionButton2 Then Frame1.Tag = 2
    End Sub
    Private Sub OptionButton3_Click()
    If OptionButton3 Then Frame1.Tag = 3
    End Sub

    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #23
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    Mdmack that looks promising to cut down on typing but how can I use that with the registry settings? Also, how can I let my users set options that would affect code directly? Ex:

    I want to let my users set it so a userform will not show. Here is the code I tested:

    [VBA]
    If GetSetting("Business Reporting Today", "DetailTab", "Dont Show") = True Then
    Organize.Hide
    End If
    [/VBA]

    I am running that code in the initialize for that form but it still shows. However I do not get an error.

  4. #24
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    What code is used to open the userform?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #25
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    [VBA]organize.show[/VBA]

    I originally want to show the code because it loads the settings that the user wants and then it hides the form.

  6. #26
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    As far as I can see Hide does nothing and Visible is not valid. You could set Height and Width to 0, but that leaves the Caption bar.
    I've no knowledge what you are using the settings for, what applies to the form, or the workbook, or the interaction between them, or really what you are trying to achieve.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  7. #27
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    I have a form that pops up for what invoices the user wants to delete and a few other options. However certain users will want to set these defaults and never see the form again but some people might always want to see the form. Also, hide I use in other situations which hides the form from sight.

  8. #28
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    Before showing the form, check the value of "Dont Show".
    [VBA]If GetSetting("Business Reporting Today", "DetailTab", "Dont Show") <> True Then
    Organize.show
    End If [/VBA]Charlize

  9. #29
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    Thank you Charlize,

    That is how I am doing it now, I just have to change the logic a little.

  10. #30
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    One last thing I am trying to do is at a later time I want to save one setting equal to another setting. To explain, I want to read the first setting and then set the second setting equal to the first setting. Is this possible?

  11. #31
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    I still can't find a way to mark a thread unsolved. Can someone do it for me? thank you

  12. #32
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Thread tools....edit thread
    edit the title and save changes
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  13. #33
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    Lucas,

    Thank you for your help but I don't have an edit thread under thread tools

  14. #34
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Solved removed from title....
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  15. #35
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    thank you

  16. #36
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    I am just reposting this to move it to the bottom:

    One last thing I am trying to do is at a later time I want to save one setting equal to another setting. To explain, I want to read the first setting and then set the second setting equal to the first setting. Is this possible?

    The reason I want to do this is My users will have their own defaults but then if one day they need to run a lot of reports with the same options (That are different than their defaults), I don't want them to have to go into settings to change their defaults and then when they are done go back to change them into their normal defaults. I am adding a check box to the bottem to reuse the settings they have chosen on the form and then to go back to their defaults they just uncheck it.

  17. #37
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    Has anyone read this?

  18. #38
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    So... what you're trying to do is create an "options" screen that your users can go to so that they can set defaults, but then not be bothered with seeing them unless they want to change them? Is that right?

    You could use a multipage control for that. I usually would put a button on the main page for "Options" that takes you to page 2. Add a button to page 2 labelled "Home" or something that takes you back to page one. Then hide the tabs at design time. Can work quite slick.

    Is that the kind of thing you meant?
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  19. #39
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    No, but close Ken. The options they go to the help drop down and then Options to set the options. But now if they are running reports that all have the same options I want to include a check box on the bottom of the screen that they can check and it will save them for the next time the form opens up but if it is unchecked it will load the default from the settings page.

  20. #40
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Where is the help dropdown, exactly? Is this the help menu, or on your userform. I assume that you've got this set to store the registry settings already?

    As for reading the stuff and setting the defaults, you'd set your defaults in the Userform_Intialize event. Or did I miss something?
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





Posting Permissions

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