Hi Ben,
I tried it and shifted the add edit code into an Overwritten onload-method
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnLoad(e)
If Me.lNeu Then
LieferBO1.Add()
Else
LieferBO1.Edit()
End If
LieferBO1.Refresh()
Me.Refresh()
End Sub
Now the follwing happens: If I start the form with a parameter for editing, the correct record is shown for editing. I can change values and save them, everything is fine.
When I choose to add a record. the form does not show, as I expected it, empty fiellds (controls like textboxes) for adding but behaves like I had choosen to add the actual record my grid is showing on the calling form.
Checking this with the debugger shows me, for example, that I enter the form with 79 records, the add-method of the BO is callled, after this I have 80 records, but the controls (text- and checkboxes and combos) aren't refreshed.
What might I have done wrong?
Best regards
Thomas