RE: Index or primary key cannot contain a null value.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I really don't think so. You may be able to accomplish this, but still, the
reason you are having problems is design. In your original post, you said it
may be a child on more than one form. Already, you are in trouble. How can
you identify the parent if you have only the child?

"JohnLute" wrote:

> I guess there are exceptions to every rule. Here's an example of my design:
>
> tblPKCorrugatedFinishingAttributes is a parent to tblPKProfilesQualifications.
>
> In this instance, a record for tblPKProfilesQualifications may exist without
> a record in tblPKCorrugatedFinishingAttributes. Why? Because a corrugated may
> not have a specific finishing attribute defined but may have several
> qualifications.
>
> In other words, qualifications are finishing attributes and are properly
> assigned as children of tblPKCorrugatedFinishingAttributes.
>
> Is there a before/after update event that can create a parent record?
>
> --
> www.Marzetti.com
>
>
> "Klatuu" wrote:
>
> > The real problem here is database design. There should never be an instance
> > where a child exists without a parent.
> >
> > "JohnLute" wrote:
> >
> > > I have a subform (sfrmPKProfilesQualifications) that's used in multiple
> > > subforms. The problem I have is that there are instances when
> > > sfrmPKProfilesQualifications will have a record and it's parent subform will
> > > not. Of course, this results in the error:
> > >
> > > "Index or primary key cannot contain a null value."
> > >
> > > I suppose an easy fix to this would be to move sfrmPKProfilesQualifications
> > > out of the subforms, however, I wanted to explore if there's a Before/After
> > > Update code that I could insert into it that would create the primary key
> > > record.
> > >
> > > Thanks in advance for your time!
> > >
> > > --
> > > www.Marzetti.com
.



Relevant Pages

  • Re: Setting MDI Parent Size To Fit Around A Child Form
    ... child size to be already modified to fit into the parent; ... or rearrange its contents to fit the ... It is not possible to change the design. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Table/Filter to show certain months
    ... Your design is well-suited ... ... ParentID (this is a foreign key, pointing back to the Parent of this ... not every child has his/her parents' lastname) ... you only need to look in the child DOB column to ...
    (microsoft.public.access.queries)
  • Re: class design question
    ... ultimately i'm looking for class design ideas. ... All i have is a simple window app that initially shows a datagrid of parent ... child records. ...
    (microsoft.public.dotnet.general)
  • Re: Types with mutual references
    ... holds a collection of "child" entities, but the parent has certain ... functions that are useful to the child entities, ... type in the "use" statement when connecting to the container type. ... I need to deal with some unsatisfying design ...
    (comp.lang.fortran)
  • Re: Types with mutual references
    ... holds a collection of "child" entities, but the parent has certain ... functions that are useful to the child entities, ... type in the "use" statement when connecting to the container type. ... I need to deal with some unsatisfying design ...
    (comp.lang.fortran)