I am using Base. error message method or property not found

I have two forms. The first form calls the second form where some data may be entered or changed. When finished it returns to form1 where
I want the data refreshed. I have been working for days with no luck to get this to work. I am using a macro I copied from the online book.
This is the Macro

Sub Update

Dim oDoc As Object
Dim oDrawPage As Object
Dim osForm As Object

oForm = oDrawpage.forms.getByName(“Instrument”)

oForm.reload()

End Sub

End Sub
I think I do not know how to make Reload() or Drawpage available to my program. I have worked for years with FoxPro but am new to Libera
Office Base or any other SQL type database and am trying to expand my knowledge base. I would much appreciate your help. Thank You

Hello,

First, if working with macros a good reference is needed. Here is the best single source: Open Office Macros Explained by Andrew Pitonyak → OOME PDF.

As for your problem, you are accessing the Form object incorrectly. Depending on where the macro is called from, it should first obtain ThisComponent or ThisDatabaseDocument ( see my answer in this post → ThisDatabaseDocument vs ThisComponent?).

With that you access Drawpage (not an object as you have), Forms and then the internal form. Careful using case. In many instances it is important.

With that, here is the statement you need to access oForm:

oForm = ThisComponent.Drawpage.Forms.getByName("Instrument")