I am using a Windows computer with XPPro running OOo Base 3.1.1 but I cannot
get the following event code to work.
Any help would be greatly

Sub UpDtEditDate(oEvent As Object)
  'Purpose:   Before record is changed, update EditDate to Now
  'Version:   9.000 01/03/10
  'Notes:     Failed when Mapped to Forms Before record action and before
record change

  ON ERROR GOTO HandelErr
  Const cstrProc as string = "UpDtEditDate"
  Dim oForm     As Object
  Dim oControl  As Object
  Dim strFormImpName As String
'  Xray oEvent
  strFormImpName="com.sun.star.comp.forms.ODatabaseForm"
  If oEvent.Source.ImplementationName <> strFormImpName Then
    GoTo ExitHere   'event fires twice so will fail the first time, skip,
until names match
  End If
'  Xray oEvent
  'Xray indicates that Columns and the getByName method is available but the
following fails
'  oControl = oEvent.Columns.getByName("EDITDATE")           '423: Property
or method not found.frm03 Ln:93

'The following works when is called from a command button, but it seems like
something like this should work with the record change event
'  oForm = oEvent.Source.Model.Parent
'  oControl = oForm.Columns.getByName("EDITDATE")
'  oControl.updateString(gn_ISOdate(Now))

ExitHere:
  Exit Sub

HandelErr:
  Msgbox Err & ": " & Error$ & mcstrMod & " Ln:"  & Erl, 16,  mcstrMod &
"."  & cstrProc
  GoTo ExitHere
End Sub

Thanks
Harold Hauge

Reply via email to