REM ***** BASIC *****
Sub writeDate
Dim today As New com.sun.star.util.Date
today.Month = Month( Now )
today.Day = Day( Now )
today.Year = Year( Now )
form = ThisComponent.DrawPage.Forms(0) ' first form
form.datFactuurDatum.BoundField.UpdateDate( today )
End Sub
This macro works fine in the form where I connected it to a button. However, when loading the form for the first time, I get the error message Object variable not set. I am not very familiar with these kind of macros so I probable made a stupid mistake, but but have not been able to solve it.
(Code made preformatted text
for readability by @Lupp )