Childform-Problem with Adding more than one record


Author
Message
Thomas Holste
Thomas Holste
StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi there,

in a main form I call a form to enter new orders. This form is connected to the

main form by a child dialog control:



Dim aParam(1) As Object

aParam(0) = "N"

aParam(1) = "B"

BestBO1.Add()

Me.ChildKlarneu.ShowDialog(aParam)

Me.ActiveControl = BestGrid



In the childform I distinguish between new positions to add and existing positions to edit. When it comes to saving, the code looks like this.



If BestBO1.Save <> MicroFour.StrataFrame.Data.SaveUndoResult.Success Then

Dim cErr As String = "Fehler beim Speichern!"

mymsgbox(cErr, 48, cProgtitle)

Else

If Me.lNeu Then

' Werte zusätzlöich holen

Me.putzekuprops()  ' Reset some form-properties

Me.Txtkunde.Text = "" ' Reset an unbound field

BestBO1.Add() ' Add a new record This BO is linked between main- and childform

BestBO1.Refresh()

Me.Refresh()

Me.ActiveControl = txtkollege ' Set focus to the first control

Else

Me.Close() ' We have choosen the edit-mode

End If

End If



If an existing record is being edited, the form closes. If a new record is saved, the childform, shall stay open and a new record shall be appended and the next position will be entered.

But this does not work. If i edit a position it works but when I enter a new position, the controls are not refreshed. When I overwrite them with new values and save this record aganin, the same happens.

When I now leave the childform and look at my grid in the main-form I can see that the first added record has been overwritten and some empty records (one for each new record which was added in my save-routine, see excerpt above).

What might be going wrong there?

Best regards

Thomas
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