Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Having been working on a program for weeks and it working perfectly I was just about to hand it over when I suddenly got this mystifying message when I haven't touch the program for days:

An error occurred creating the form. See Exception.InnerException for details. The error is: Conversion from string "B" to type 'Boolean' is not valid.



VB
Namespace My

    'NOTE: This file is auto-generated; do not modify it directly.  To make changes,
    ' or if you encounter build errors in this file, go to the Project Designer
    ' (go to Project Properties or double-click the My Project node in
    ' Solution Explorer), and make changes on the Application tab.
    '
    Partial Friend Class MyApplication

        <Global.System.Diagnostics.DebuggerStepThroughAttribute()>  _
        Public Sub New()
            MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
            Me.IsSingleInstance = false
            Me.EnableVisualStyles = true
            Me.SaveMySettingsOnExit = true
            Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
        End Sub

        <Global.System.Diagnostics.DebuggerStepThroughAttribute()>  _
        Protected Overrides Sub OnCreateMainForm()
            Me.MainForm = Global.Nirro.fmMaintain
        End Sub
    End Class
End Namespace


I turned off the "Just me" option in debugging to get this far but can't get any further.
The high lighted part seems to be where the problem is, but that's of no help to me.
I'm getting this error just loading the form up!!
There's no code in the "Public Class fmMaintain" section ( I removed it )

It stops on the "Me.MainForm = Global.Nirro.fmMaintain" part

Help please!!
Posted
Updated 2-Feb-12 22:19pm
v2

1 solution

Solved it by creating the whole program line by line. The culprit was an if statement.

TxtCondition.Text <> "A" or "B" or "C".

Thanks Microsoft!!!
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900