Problem with Form Inheritance

Posted on 2007-11-19
Medium Priority
Last Modified: 2010-04-23
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?
Question by:Emanuele_Ciriachi
  • 2

Accepted Solution

cottsak earned 1024 total points
ID: 20317911
you might need to add the 1st prject as a reference to the second. before you do that the parent class wont be visible.

Expert Comment

ID: 20318205
You would also need to add

imports humanitas

at the beginning of the code for the second project

Author Comment

ID: 20319364
Importing the base class project in the forms which extend it worked, thank you.

Author Closing Comment

ID: 31410066
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.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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.

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
Through the video, you can check the migration process of Outlook PST file to PDF. Kernel for Outlook to PDF tool can convert Outlook emails with all attributes like Subject, To, From, Cc, Bcc and other folders such as Inbox, Outbox, Sent Items, Jun…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question