Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 16036

[RESOLVED] Dim form as variable not working with latest windows update?

$
0
0
I had this code which has been working well for years:

Code:

        Dim fm As Form
        If BooLeanCheck = True Then
            fm = Form14
        Else
            fm = Form4
        End If

It uses fm as a variable to then send either form4 or form14 into a splitcontainer. However, with the latest windows update I am now getting the following error.

System.InvalidCastException: 'Unable to cast object of type 'Form14' to type 'Microsoft.Office.Interop.Access.Form'.'

I use Excel Interop in the application, but not Access. I also have never had this issue before. Any ideas or quick fixes?

~Frab

Viewing all articles
Browse latest Browse all 16036

Trending Articles