anbei eine kleine Beispiel Datenbank zum Erforschen.
Das Makro
Code: Alles auswählen
Sub insert_Date
oform = thiscomponent.drawpage.forms.MainForm
if oform.isnew = true then
dim odate as new com.sun.star.util.Date
odate.day = day(now())
odate.Month = month(now())
odate.Year = year(now())
ogrid=oform.getbyname("MainForm_Grid")
ocolumn = ogrid.getbyname("Datum")
ocolumn.boundfield.updatedate(odate)
oform.insertrow()
endif
End Sub
Klicke in eine neue Zeile, und du siehst wie das heutige Datum eingetragen wird.
Gruß R