I have two forms, one call the other from a button linked with a macro command.
I’m trying to just move state of my opened form at “new record” (same state if i click Form navigation bar button arrow “new record”). Then eventualy, set value of a field (listbox for a foreign key field).
But the method named “moveToInsertRow” show an error SQL message.
Here is my macro code:
Option Explicit
Type ProduitsTable
ID As Integer
Model As String
Categorie As Integer
Nom As String
Desciption As String
Marque As String
end Type
Sub OpenProduitWithCategory(oEvent)
Dim callerForm, callerMainForm
Dim produitFormulaire, produitMainForm, produitCategory, produitDoc, produitCtrl
Dim Produits As ProduitsTable
callerForm = oEvent.source.model.Parent
callerMainForm = callerForm.parent
Produits.Categorie = callerMainForm.GetByName("Catégorie sélection").getcurrentValue(1)
produitFormulaire = ThisDatabaseDocument.FormDocuments.getByName("Produit")
produitFormulaire.open
produitDoc = produitFormulaire.GetComponent
produitCtrl = produitDoc.getCurrentController
produitMainForm = produitDoc.drawpage.forms.getByName("MainForm")
produitCategory = produitMainForm.getByName("Catégorie sélection")
produitMainForm.moveToInsertRow
End Sub
and the error provide by libreoffice (is also cut because i can not change dimension of the dialogbox for read full message, libreoffice lock the GUI dimension box ability) is:
error exception happen
type: com.sun.star.sdbc.SQLException
message: error function sequence…
(nothing more, i don’t know if this normal to have this so short error information or if it is because libreoffice on linux doesn’t let user change dimension of the dialog message box who show messages… but i have to do with that)
and here is my full odb file about that: https://filebin.ca/3e63o6PtBjqw/Computer_elements.odb
What i not understand ? (hope it is not a bug)
I try to find and use XRay tool for see what kind of methods exists… read volonters codes and tutos, fight two days for slow evolution. It means to be very complicate to do currents usual things.