ChildFormDialog errors


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I have set up a few forms using the ChildFormDialog and the Startaframe Sample Database (I have used LesPinters sample tutorial)

I have it mostly working with just a few issues. The Delete is working fine but have an issue with the edit and save.

When I go to the Edit Form, I can see the data for the record but the textboxes are disbled. My code is:

private void btnEdit_Click(object sender, EventArgs e)
{
customerNotesBO1.SeekToPrimaryKey((Int32)listView1.SelectedItems[0].Tag);
if (childFormDialog1.ShowDialog() == DialogResult.OK) { listView1.Requery(); }
}

When I go to Add, I can enter details into the text boxex but when I save, I get an Insert Statement conflict with foreign key constraint.  See attachement


Attachments
ChildFormError.png (87 views, 100.00 KB)
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Many thanks Ivan, I have the child from working (I think) now. My problem was that , on the Form, I did not have the parent property of the Child form set .I have a few questions on the ChildFormDialog

1. Is it necessary to always set the parent property on the Child Form (is thsi not set in the ChildFromDialogue)

2. One of my problems was that I could not 'Edit' the text boxes when I had a button to call the form. I just put in a MyBO.Edit() . is this the correct approcah here, in other words do I need to do this ?

3. I am unsure as to what BO to place on which forms. On the List Form that I use, I placed both the Parent and Child, but also nocticed that they are on there twice, but I can only see them once of the form. There is a MyParentBO1 and a MYChildBO1 as aell as MyParentBO and MyChildBO. I dont think I put them on and also, I can access all their methods , but not their properties (i.e. The Fields from the Table)

4. On My Edit Form (Where I am editing the Child) I have the ChildForm BO (which I need to Bind the text Boxes). I had'nt got the parent form (but it seemed to work ok) , and then when I stuck on the parent Form, I did not need to set the parent property of the child form to the parent  form . Is this ok . What is the correct procedure to adopt here ?

Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi. Just wondering if anybody has any thoughts on above

Am starting to do a lot now with Child Forms and would like to understand whats going on

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