472,967 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,967 software developers and data experts.

New Form call from Inherited Form

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
3 1484
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Paradox | last post by:
Hey, I'm trying to figure out what situations call for the use of a derived form control such as: public class myListBox : System.Windows.Forms.ListBox and what situations call for the use...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
13
by: Lorne Smith | last post by:
Hi, First, sorry for the crosspost, but it seemed appropriate... :) I've come accross what I consider to be a bug, but I don't know if it's already known or not. (VS .Net 2003 Pro - VB.Net) ...
4
by: JC Voon | last post by:
Hi: My base form has a button, when click it will call MessageBox.Show( "Base form" ). I inherite a child form from the base and assign a button click event to the same button which will call...
4
by: dbuchanan | last post by:
Is the following behavior normal? Both the 'Protected sub' in the inherited form and the 'Private Shadows sub' in the derived form fires. My interpretation of MSDN help on the topic "Shadows"...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
2
by: Steve Teeples | last post by:
I have a simple form with a panel that is docked in the base form. The panel has three controls - two buttons and one treeview. I use "Inherited Form" when creating a second form derived from...
4
by: asad.naeem | last post by:
hi to all this is the problem about inheritence. I have designed a form with some essential controls which are required for every form which will inherited from it. for example i have Button1 on...
6
by: Arkadiusz Smolak | last post by:
Hi, I need a help. I have form inherited from other form. The base form implementation is placed in other assembly. I try to open my inherited form in designer but visual studio throws an...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.