Problem with RegisterForeignKey()


Author
Message
Doron Farber
Doron Farber
StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)StrataFrame User (152 reputation)
Group: Forum Members
Posts: 92, Visits: 612
Hi Trent,

I have the following tables:
  1. Company (Parent)
  2. MemberInfo (Parent)
  3. Address Mem(Child to 1 and 2 above)

In the AddressMemBO I have a relationship define for the MemberInfo (put the relation info here) I have a form where I want to use AddressMemBO related to Company so the correct AddressMemBO.Company_FK) can be updated automatically, I am trying to use the BO.RegisterForeingKey method to archive this with the following code:


Private Sub CompanyBO1_ParentFormLoading() Handles CompanyBO1.ParentFormLoading
 Me.CompanyBO1.RegisterForeignKey(Me.AddressMemBO1, "Company_FK")
 Me.CompanyBO1.FillAllRecords()

 If Me.CompanyBO1.Count > 0 Then
  Me.AddressMemBO1.FillByParentPrimaryKey(Me.CompanyBO1.Company_PK)
 End If

 Me.lstAddress.Requery()
End Sub



The above code is not working, the BO.FillByParentPrimaryKey() is not returning any record, where I am sure there are related records in the database, also when adding a new AddressMem record, the Company_FK is not being updated.

Now if I change in the AddressMemBO class relationship via the class to it will be with Company table instead of MemberInfo, it will work just fine. (One relation at the time).

So what am I missing in the use of BO.RegisterForeingKey?

Thanks,

Doron

The 


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search