PDA

View Full Version : Solved: Show if no setting



Djblois
04-26-2007, 11:29 AM
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:

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

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

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

Bob Phillips
04-26-2007, 11:38 AM
Works fine for me, why don't you do



MsgBox GetSetting("Business Reporting Today", "General", "Professional")


to see what you have got there.

Djblois
04-26-2007, 11:56 AM
I am trying it on machines that have no settings saved yet. So that would be blank. I even tried this

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

Bob Phillips
04-26-2007, 12:03 PM
All the facts help a lot



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

Djblois
04-26-2007, 12:55 PM
xld that worked