Please could someone tell me how to improve this simple macro: It is meant to add an integer value into a particular field in a form so that when the form is saved this value is part of the new record. If the form is called ‘Form’ and the name of the field where the value should be added is “Field” and the integer variable whose value is to be stored is called ‘x’ then trying
Dim oForm As Object
Dim oField As Object
Dim x As Integer
oForm = ThisComponent.Drawpage.Forms.getByName("Form")
oForm.moveToInsertRow
oField = oForm.getByName("Field")
oField.Text = x
displays the value x in the field but it fails to appear on the new record when the form is saved. Anything that I enter into other fields is however saved. (If I overwrite the value in ‘Field’ after it has been displayed by the macro it will also be stored in the new record!). Hope someone will save me from further bashing my head against the wall.