Re: [libreoffice-users] Open form from button

2024-07-02 Thread Robert Großkopf

Hi Edwin,


Is it possible to open to put a button in a form to open a different 
form from a linked field?


One possibility:
Create a table "tbl_Filter". Might be you are already using such a table 
for only one row. This table should contain a field like "Plant_ID". So 
you could save the identifier for the plant in this table.

Open the new form, which depends on a query like this:

SELECT * FROM "MyTable" WHERE "ID" = (SELECT "Plant_ID" FROM "tbl_Filter")

Might be a macro like this helps:

SUB OpenFormPlant(oEvent AS OBJECT)
   oForm = oEvent.Source.Model.Parent
   IF hasUnoInterfaces(oForm, "com.sun.star.form.XForm" ) THEN
  stID = oForm.getString(oForm.FindColumn("ID"))  
  oConnection = oForm.activeConnection()
  oSQL_Statement = oConnection.createStatement()
  stSql = "UPDATE ""tbl_Filter"" SET ""Plant_ID"" = '"+stID+"'"
  oSQL_Statement.executeUpdate(stSql)	 
ThisDatabaseDocument.FormDocuments.getByName("frm_PropagatingPlant").open

   END IF   
END SUB

Regards

Robert
--
Homepage: https://www.familiegrosskopf.de/robert


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


[libreoffice-users] Open form from button

2024-07-02 Thread Edwin Humphries

Hi all

Is it possible to open to put a button in a form to open a different 
form from a linked field?


I have a form that gives general information about the use of a plant in 
landscaping, and a quite different form that gives information about 
propagating that plant. I'd like to have a button to open the second 
form from the first.


--

Regards,
Edwin Humphries
Mobile: 0435 672 457

I acknowledge the traditional Wodi Wodi custodians, their elders and 
customs, of the Dharawal lands on which I live.


"At every moment he beholdeth a wondrous world, a new creation, and 
goeth from astonishment to astonishment, and is lost in awe at the works 
of the Lord of Oneness." Bahá'u'lláh
"... humans are interesting. With all the wonders there are in the 
Universe, they invented boredom." Terry Pratchett, Hogfather
"The most beautiful thing we can experience is the mysterious. It is the 
source of all true art and all science. He to whom this emotion is a 
stranger, who can no longer pause to wonder and stand rapt in awe, is as 
good as dead: his eyes are closed." Albert Einstein
"Stuff your eyes with wonder ... live as if you'd drop dead in ten 
seconds. See the world. It's more fantastic than any dream made or paid 
for in factories." Ray Bradbury

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy