Inherited forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm building a small desktop database app. I am building a template form that
has navigation and editing coded, and want to inherit this for my actual data
forms. When I add a form, and change the inherits statement to point to the
form I want, as soon as I try to view it in the designer I get an error:
Value can't be null. Parameter name: dataSource.
It looks like the parameter for the binding manager, so I tried removing the
reference in my template, and still get the error. I tried wrapping the
bindingmanager = me.bindingcontext(dataSource) in a try statement, and that
didn't help. I can't find any other place where a data source is referenced
in the template. Ideas much appreciated.
 
I think you're going about it in a manner not intended by Mr. Gates & co.

You have your base form. Then build your solution. Then, don't add a
Windows form, add an Inherited Form. Here, you will first Name your new
form, then, you will select which form it inherits from.
 
Randy,

The currencymanager fires often as well while initializing. So try to set
the code that uses binding inside a booleanswith what you set to true when
the initializing is done. We see not much from your code, so this is only a
big gues

I hope this helps?

Cor
 
RandyR said:
When I add a form, and change the inherits statement to point to
the form I want, as soon as I try to view it in the designer I get an error:
Value can't be null. Parameter name: dataSource.

Do you need this code in your Base Class running in the Designer?
If not, try wrapping it in

If Not Me.DesignMode Then
' Code that only runs "for real".
End If

HTH,
Phill W.
 
I can't pinpoint the code causing the failure - there's only one place where
I have a dataSource argument, and even deleting that line doesn't help. So I
don't know where this would fit.
 
I tried your suggestion, and still no success; could be I'm not placing
correctly. I added a form level variable in my base form set to false, and at
the end of the initialize routine set it to true. In the form load, I set the
binding manager; no joy. I also tried removing
manager=me.bindingcontext(MyData) before inheriting the form and no luck.
Could it be because I've got procedures that reference the binding manager?
Thanks for your help.
 
Randy,

That can be, I think that the best is to try to keep your binding inside
your template form or to keep it completly outside.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

form inheritence 9
Inherited Form - Question 2
Inherited Form 1
inheriting forms 1
Inherited form is not present in VB 2005 express 3
Form Inheritance 10
Form inheritance problem 6
Inherited from Localization 2

Back
Top