Proper way of programmatically loading a base form

Hello everyone,

I have searched this forum and came up with two methods of loading a form:

  1. ThisDatabaseDocument.FormDocuments.getByName(‘name’).open()
  2. ThisDatabaseDocument.CurrentController.loadComponent(ObjType, ObjName, LoadForEditing)

Other than the last parameter in the second option, are these basically the same?

Option 1 opens the named Form document in the live/data entry mode.

Option 2 is more generic. Depending on the arguments given it can open Tables, Form documents, Queries or Reports in either the live or design mode. For instance using the arguments ( 2, “name” , False) would accomplish the same thing as Option 1

https://www.openoffice.org/api/docs/common/ref/com/sun/star/sdb/application/XDatabaseDocumentUI.html#loadComponent

@UnklDonald thank you very much for taking the time to reply and for a clear explanation.