By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,005 Members | 1,226 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,005 IT Pros & Developers. It's quick & easy.

New Form call from Inherited Form

P: n/a
This one has me stumped. I have a base form I am trying to wrap up, but I
have one problem. In two functions I am opening a "record detail" form. I
would like to keep the code in the base form and pass info to the form
telling it which from to actually open. Any ideas how to do this? Here is
an example of what I had in mind if the text isn't clear enough...

Base Form

Function EditRecord()
Dim frmRecord as New Form()
frmRecord.Filter = "ID = 2"
frmRecord.Show()
End Function

In the non inherited version of my form, I can easily declare the frmRecord
variable as the actual form needed to view the detail. But I want the
frmRecord to take on the attibutes of Form_Employee_Detail, or
Form_Invoice_Detail, or Form_Transaction_Detail, etc. I think you get the
idea.

Any help would be greatly appreciated! Thanks!

John A. Prejean
jo**@gcit.net
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Any instance of a derived type can be set back to a variable of the base
type. As long as the ID that you want to filter on is the same between all
derived forms, you can do this. Use the derived form's constructor to set
the filter criteria for the record

Class Employee_detail_Form
inherits BaseForm

sub new()
frmRecord.Filter = "ID = 2"
end sub
end class

Class BaseForm
Function EditRecord()
Dim frmRecord as New Form()
frmRecord.Show()
End Function
end Class
--------------------
From: "John A. Prejean" <jo**@gcit.net>
Subject: New Form call from Inherited Form
Date: Mon, 16 Feb 2004 12:47:13 -0600
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#h**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: wsip-68-14-193-229.no.no.cox.net 68.14.193.229
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!cpmsftng xa10.phx.gbl!TK2MSFTNGXA05
.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gblXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:181862
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

This one has me stumped. I have a base form I am trying to wrap up, but I
have one problem. In two functions I am opening a "record detail" form. I
would like to keep the code in the base form and pass info to the form
telling it which from to actually open. Any ideas how to do this? Here is
an example of what I had in mind if the text isn't clear enough...

Base Form

Function EditRecord()
Dim frmRecord as New Form()
frmRecord.Filter = "ID = 2"
frmRecord.Show()
End Function

In the non inherited version of my form, I can easily declare the frmRecord
variable as the actual form needed to view the detail. But I want the
frmRecord to take on the attibutes of Form_Employee_Detail, or
Form_Invoice_Detail, or Form_Transaction_Detail, etc. I think you get the
idea.

Any help would be greatly appreciated! Thanks!

John A. Prejean
jo**@gcit.net


Nov 20 '05 #2

P: n/a
Couldnt you just expose the entire form.

Private mfrm_RecordForm as RecordFormType = new RecordFormType

BaseForm
Public Readonly Property RecordForm()as RecordFormType
return mfrm_RecordForm
End Property
End BaseForm

then inside anyother classes you would use (baseform.recordform.filter = "ID
= 2")

Bryan Martin
sp**@ahwayside.com
"John A. Prejean" <jo**@gcit.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
This one has me stumped. I have a base form I am trying to wrap up, but I
have one problem. In two functions I am opening a "record detail" form. I would like to keep the code in the base form and pass info to the form
telling it which from to actually open. Any ideas how to do this? Here is an example of what I had in mind if the text isn't clear enough...

Base Form

Function EditRecord()
Dim frmRecord as New Form()
frmRecord.Filter = "ID = 2"
frmRecord.Show()
End Function

In the non inherited version of my form, I can easily declare the frmRecord variable as the actual form needed to view the detail. But I want the
frmRecord to take on the attibutes of Form_Employee_Detail, or
Form_Invoice_Detail, or Form_Transaction_Detail, etc. I think you get the
idea.

Any help would be greatly appreciated! Thanks!

John A. Prejean
jo**@gcit.net

Nov 20 '05 #3

P: n/a
The problem is the form I am trying to open is neither the derived nor base
form. This is what I have...

Class Employee_Detail_Form
....
End Class

Class Invoice_Detail_Form
....
End Class

Class BaseListForm
Function EditRecord()
?? Dim frmRecord as New Employee_Detail_Form()
?? Dim frmRecord as New Invoice_Detail_Form()
frmRecord.Show
End Function
End Class

Class EmployeeListForm
Inherits BaseListForm

''' When call is made from this form, I want it to use
Employee_Detail_Form
End Class

Class InvoiceListForm
Inherits BaseListForm

''' When call is made from this form, I want it to use
Invoice_Detail_Form
End Class
How can I get the call to be a variable that can change based on a
parameter. I already have it setup to override certain functions. But I
could really clean up the processes if I can get past this hurdle.

Thanks!!!

"Dot Net Team [MSFT]" <vb******@online.microsoft.com> wrote in message
news:Uj**************@cpmsftngxa07.phx.gbl...
Any instance of a derived type can be set back to a variable of the base
type. As long as the ID that you want to filter on is the same between all derived forms, you can do this. Use the derived form's constructor to set
the filter criteria for the record

Class Employee_detail_Form
inherits BaseForm

sub new()
frmRecord.Filter = "ID = 2"
end sub
end class

Class BaseForm
Function EditRecord()
Dim frmRecord as New Form()
frmRecord.Show()
End Function
end Class
--------------------
From: "John A. Prejean" <jo**@gcit.net>
Subject: New Form call from Inherited Form
Date: Mon, 16 Feb 2004 12:47:13 -0600
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#h**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: wsip-68-14-193-229.no.no.cox.net 68.14.193.229
Path:

cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!cpmsftng xa10.phx.gbl!TK2MSFTNGXA05 phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:181862
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

This one has me stumped. I have a base form I am trying to wrap up, but Ihave one problem. In two functions I am opening a "record detail" form. Iwould like to keep the code in the base form and pass info to the form
telling it which from to actually open. Any ideas how to do this? Here isan example of what I had in mind if the text isn't clear enough...

Base Form

Function EditRecord()
Dim frmRecord as New Form()
frmRecord.Filter = "ID = 2"
frmRecord.Show()
End Function

In the non inherited version of my form, I can easily declare the frmRecordvariable as the actual form needed to view the detail. But I want the
frmRecord to take on the attibutes of Form_Employee_Detail, or
Form_Invoice_Detail, or Form_Transaction_Detail, etc. I think you get theidea.

Any help would be greatly appreciated! Thanks!

John A. Prejean
jo**@gcit.net

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.