[libreoffice-users] Re:Libre-Base Pushbutton Macro
Dear Sir, I would be much obliged if you could help me with the following problem Using LibreBase (Ubuntu 11.10) I tried to make a pushbutton macro to open a form Name2c from within another form From the Internet I get the following script Sub OpenAForm(oEv As Object) Dim GetFormName As String Dim GetForm as Object GetFormName = Name2c GetForm = ThisDatabaseDocument.FormDocuments.GetByName(GetFormName) GetForm.Open End Sub however when I run it the following message appears Basic runtime error Object variable not set Could you provide me with the correct script Thanking you for your attention and cooperation Your Investment - Wealth - Health - Education consultant Budi Machribie (F06592) The SunHorse Team PT.Sunlife Finance Indonesia Gd CIMB-Niaga 3Ath fl Jl.Jen.Sudirman kav 25 Jakarta 12920 +08161815979 Blog-http://tough2slf.multiply.com/ Website: http://www.tough2slf.net78.net/ End Sub -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.odt Info: http://www.pitonyak.org/oo.php -- For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted -- For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
Re: [libreoffice-users] Re:Libre-Base Pushbutton Macro
On Wed, 2011-11-09 at 15:36 -0800, budi machribie wrote: Dear Sir, Hi Budi For future reference - It is much better if you start a new thread for new questions, rather then changing the subject line from an existing discussion. I would be much obliged if you could help me with the following problem Using LibreBase (Ubuntu 11.10) I tried to make a pushbutton macro to open a form Name2c from within another form From the Internet I get the following script Sub OpenAForm(oEv As Object) Dim GetFormName As String Dim GetForm as Object GetFormName = Name2c GetForm = ThisDatabaseDocument.FormDocuments.GetByName(GetFormName) GetForm.Open End Sub however when I run it the following message appears Basic runtime error Object variable not set Yeah - the problem is that the psudo variable ThisDatabaseDocument is only valid when the macro is contained in a basic library embedded in the ODB file - and refers explicitly to this Base file without regard from where it's called. So, I'm guessing your calling it from a shared Basic library, just move the code into the ODB file and your good to start. Best wishes, //drew -- For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted