Hello Peter, the wide variety of answers here show that the concepts are clearly too ... complex.
> in a form which is connected to a server db I filled some text fields > with api. > The content of these fields are not saved by clicking the "Save > record"-button. Only typing or pasting seems to fire an event, that the > content has changed. > > Otherwise, when loading the next record, the contents of these fields > are not updated when the content of the column is null, so the formerly > by api inserted data of the last record are not overwritten. > > It's a strange behavior, isn't it? For a control bound to a database field, there's a trinity of components involved: The control (the visual component which the user interacts with), the control model (describing look and behaviour of the control), and the form field which actually holds the data of one particular column of the result set which is represented by the form. What your code modified is the control model itself. This alone does not interact with the result set, and thus not with the database. In particular, the Form Runtime will not recognize this control/model as being modified, and thus not write its content into the database field. Thus the behavior you observed. The ".commit" call suggested my Marc explicitly commits the control/model content to the database field, thus is will be propagated to the database later. Andrew's suggestion modifies the control instead of the control model. I am not sure whether the observed behaviour - the form being "modified" afterwards - is correct by today's definition. I know that there were ongoing discussions which actions on an UNO control (and form controls are UNO controls, somewhat extended) should result in modifications (technically: in certain listeners being called). The bottom line is: Don't use the control :) Mathias' suggestion gets the most points :). The BoundField property of the control model refers to the database field which the control is bound to. Modifying this one is, speaking strictly, the only proper solution. Ciao Frank -- - Frank Schönheit, Software Engineer [EMAIL PROTECTED] - - Sun Microsystems http://www.sun.com/staroffice - - OpenOffice.org Base http://dba.openoffice.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
