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?
LVL 1
Emanuele_CiriachiAsked:
Who is Participating?
 
cottsakConnect With a Mentor Commented:
you might need to add the 1st prject as a reference to the second. before you do that the parent class wont be visible.
0
 
doraiswamyCommented:
You would also need to add

imports humanitas

at the beginning of the code for the second project
0
 
Emanuele_CiriachiAuthor Commented:
Importing the base class project in the forms which extend it worked, thank you.
0
 
Emanuele_CiriachiAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.