Consulting

Results 1 to 5 of 5

Thread: Solved: Show if no setting

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

    Solved: Show if no setting

    I am using this code to show a form on install only if my user wants to see it. However, if they have never saved their settings before it doesn't show it either. Here is the code:

    [VBA]On Error Resume Next
    If GetSetting("Business Reporting Today", "General", "Show New Features") = True Then
    NewVersionForm.Show 0
    End If[/VBA]

    and in another spot I use this code and it won't work either:

    [VBA]Sub addToolBar()

    On Error Resume Next
    If GetSetting("Business Reporting Today", "General", "Professional") = True Then
    ProfessionalEdition 'this is a sub
    End
    ElseIf GetSetting("Business Reporting Today", "General", "Standard") = True Then
    StandardEdition 'this is a sub
    End
    End If
    'if the user never set their settings before this form should show but it doesn't
    InstallForm.Show
    End Sub[/VBA]

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Works fine for me, why don't you do

    [vba]

    MsgBox GetSetting("Business Reporting Today", "General", "Professional")
    [/vba]

    to see what you have got there.

  3. #3
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    I am trying it on machines that have no settings saved yet. So that would be blank. I even tried this

    [VBA]On Error Resume Next
    if err then
    'if the user never set their settings before this form should show but it doesn't
    InstallForm.Show
    end if
    If GetSetting("Business Reporting Today", "General", "Professional") = True Then
    ProfessionalEdition 'this is a sub
    End
    ElseIf GetSetting("Business Reporting Today", "General", "Standard") = True Then
    StandardEdition 'this is a sub
    End
    End If
    [/VBA]

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    All the facts help a lot

    [vba]

    Dim fResult As Boolean
    On Error Resume Next
    fResult = GetSetting("Business Reporting Today", "General", "Professional")
    On Error GoTo 0
    If fResult = True Then
    ProfessionalEdition 'this is a sub
    End
    Else
    On Error Resume Next
    fResult = GetSetting("Business Reporting Today", "General", "Standard")
    On Error GoTo 0
    If fResult = True Then
    StandardEdition 'this is a sub
    End
    End If
    End If
    [/vba]

  5. #5
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    xld that worked

Posting Permissions

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