Link to home
Start Free TrialLog in
Avatar of Emanuele_Ciriachi
Emanuele_Ciriachi

asked on

Problem with Form Inheritance

Hello, I don't seem to be able to have a simple Form Inheritance in my project.
I have a separate project in my solution with a single .vb form, with the following code:

------------------------
Public Class FormsCommon

    Public ErrorPresent As Boolean
    Public AlreadyDone As Boolean
    Public TableCode As String

    Private Sub FormsCommon_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class

Public Interface CommonInterface
    Sub ControllaForm()
End Interface
-------------------------------

Then I try to create, in another project, a VB form that inherits from this one:

------------------------------
Public Class DemographicDataInformedConsent
    Inherits Humanitas.FormsCommon

    TableCode = "SDEM"
------------------------------

...but I simply get: "TableCode is not declared".

What am I doing wrong?
ASKER CERTIFIED SOLUTION
Avatar of cottsak
cottsak
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You would also need to add

imports humanitas

at the beginning of the code for the second project
Avatar of Emanuele_Ciriachi
Emanuele_Ciriachi

ASKER

Importing the base class project in the forms which extend it worked, thank you.
Nice and quick, managed to get me back on track and as such I give an "A". Would have liked an example to make the solution even more complete.