LIBREOFFICE BASE - CREATE A SWITCH BOARD TO OPEN FORMS USING A PUSH BUTTON

Sdílet
Vložit
  • čas přidán 8. 09. 2024
  • If you liked this video donate: www.paypal.com...
    PLEASE READ SINCE DOING THIS VIDEO LIBREOFFICE 4.1 now only likes UPPERCASE and LOWERCASE to be exact as they programmed it. See Below.
    Your code:
    oNewFormDocument = ThisDatabaseDocument.FormDocum­ents.getbyname(sNewDocumentNam­e).open
    Change to:
    oNewFormDocument = ThisDataBaseDocument.FormDocum­ents.getbyname(sNewDocumentNam­e).open
    Notice 'ThisDataBaseDocument' The B in base has to be UPPERCASE for the switch board to work in LibreOffice Base 4.1
    As you may or may not know creating a push button to open a form in Libreoffice Base is non existent. Unlike in Access where there is a little wizard to do all the work for you. This Video shows you how to use Libreoffice Basic/Macros to force a button to open a form.
    This video demonstrates a basic switch board with 3 forms.

Komentáře • 78

  • @KurtWoloch
    @KurtWoloch Před 4 lety +6

    I'd refactor this a bit... create another subroutine "OpenForm (formname as String)" (if that works here) which then in turn contains the long line for actually opening the form, and call it instead of defining the constant and then doing the long line in each OpenForm_X routine, so that the only line in sub OpenForm_3 would be "OpenForm "Form3"".

  • @1supa1
    @1supa1 Před 11 lety +1

    This is really great, plain and simple. Saved me a lot of pain!

  • @dmb1319
    @dmb1319 Před 3 lety +1

    EXCELLENT! Really outstanding tutorial. Easy to understand and follow and, although there are slight differences, worked very nicely with LO78. Great intro to BASIC as well as macros. THANKS!

  • @mividalocastudio9366
    @mividalocastudio9366 Před 2 lety +1

    Awesome video. THANK YOU! Finally, someone who could explain it correctly and without having it take 2 hours LOL

    • @shanepiper
      @shanepiper  Před 2 lety +1

      If after doing this video 9 years ago, is finally to you then great glad to have helped 😂

    • @mividalocastudio9366
      @mividalocastudio9366 Před 2 lety

      @@shanepiper please make more Libre Office Base videos!

    • @shanepiper
      @shanepiper  Před 2 lety

      @@mividalocastudio9366 kind of defeats the whole purpose of the channel being called Odoo made Easy... But if I was to do so what content would you want?

  • @johndavy3820
    @johndavy3820 Před 4 lety +3

    Great job! It was very helpful. It was just what I needed. Thanks, John

  • @AthanasiosDeme
    @AthanasiosDeme Před 10 měsíci +1

    Thank you. It worked in LO7.4.

    • @shanepiper
      @shanepiper  Před 10 měsíci

      that is really good to know thanks for the reply

  • @edwardowen8668
    @edwardowen8668 Před 7 lety

    This is a great video. Straight and to the point, easy to follow (even with the accent :). Yes I'm a Yank....

  • @NoviDooms
    @NoviDooms Před 3 lety

    Thank you!! I have been searching all over for something like this!

  • @john11028
    @john11028 Před 9 lety +1

    Brilliant,you made it so simple.
    Thanks

  • @vincejessel9609
    @vincejessel9609 Před 3 lety

    Thanks for a great tutorial.This is no longer a mystery

  • @tylermadrid3551
    @tylermadrid3551 Před 9 lety +1

    This video is amazing and exceeded my expectations. Thank you so much!

  • @nickkruger213
    @nickkruger213 Před 11 lety

    Thanks for taking time to make this video! It was very helpfull.
    Nick (Cape Town).

  • @shanepiper
    @shanepiper  Před 11 lety

    Hello Ian, I am pleased that you have the Sub forms working.. I would suggest that you take a look at the security options and ensure you have macros enabled.

  • @TheGusterr
    @TheGusterr Před 6 lety

    you are cool... thanks

  • @allantin009
    @allantin009 Před 11 lety +1

    I am interested to create a small guide about the basic programming language in libreoffice and small examples(only in writing not videos :D ) to help people creating powerful forms with libreoffice.
    As I said before THANK YOU for your time , creating those videos and helping the community and reading my post.

  • @allantin009
    @allantin009 Před 11 lety

    thank you very much! Great job. Keep doing it.

  • @EndaSims3
    @EndaSims3 Před 9 lety +2

    This is great thanks- but how do I get the switchboard to open when the database launches ???

  • @shanepiper
    @shanepiper  Před 11 lety

    I think you can rule out the MySQL side as the LO Basic only calls the form within LO Base. I run a test today at work for you on my windows system of which I am using OpenOffice 4.0.0 and all seems to be working fine. There was no need to add a database as I mentioned its not really required for this exercise.
    I would suggest removing the '.' in your form and the macro so your form reads "FedSaintsNewStory" and not "FedSaintsNew.Story"

  • @martinvisintini4369
    @martinvisintini4369 Před rokem

    Thanks,! saved me!

    • @shanepiper
      @shanepiper  Před rokem

      Your welcome nice to know a video I posted years ago is still helping 😊

  • @ozarkbunnyboy
    @ozarkbunnyboy Před 8 lety +2

    2 questions:
    How can I make the switchboard buttons not only open their respective forms but also simultaneously close all other forms?
    How can I display all forms, including switchboard, without the menus and toolbars? i.e. make it look more like an end user application.

  • @RubbeRxD
    @RubbeRxD Před 11 lety

    Thank You Very Much!

  • @ianwhitfield9438
    @ianwhitfield9438 Před 11 lety

    Tks Shane for your reply!!
    YES - I have macros enabled - I've tried 'Med' and 'Low' and no diff. It does not "see" the Macro so that I can select it. The OK button remains grayed-out. I'm sure this was working fine in earlier LO versions. Maybe I must revert to ver 3 or 4.0??

  • @MdBadol-gn2pv
    @MdBadol-gn2pv Před 2 lety +1

    Great. How to create push button macro in openoffice

  • @Exotic0101
    @Exotic0101 Před 10 lety +1

    نريد المزيد من الدروس التي تشرح كتابة كود
    We want more of the lessons that explain in writing code

  • @ianwhitfield9438
    @ianwhitfield9438 Před 11 lety

    OK - I've tried the Form Name with and without the DB name in front of it - No change.
    So I started up my old Laptop running the embedded HSQL and LO 3.6.5.2 and did the same set-up of the Form and the Macro - AND IT WORKS!!
    So that means the problem is either with my new MySQL engine or the new Version of LO (4.1.1.2) I would think!!
    Your comments - and what do you use (LO version and DB engine)??

  • @sebastienlebel7725
    @sebastienlebel7725 Před 11 lety

    thks you man :) very helpful.

  • @mostytube
    @mostytube Před 9 lety

    thanks very much

  • @shanepiper
    @shanepiper  Před 11 lety

    If you want to open up a new questionnaire you simply tell the Main form that you want to only have the form set to 'Add Records' right click on the questionnaire form, press 'Edit' now open up the form navigator. location the main form, this should be at the top, right click it and choose 'Properties', click the Data tab and set the 'Add Data Only' to YES. This will tell Libreoffice to only show a new blank record. If you want review the data copy and paste another form and set ADO to NO.

  • @shanepiper
    @shanepiper  Před 11 lety

    I have found the issue with the script,
    LibreOffice Basic is now very particular with Upper and Lowercase letters in variable.
    Your code:
    oNewFormDocument = ThisDatabaseDocument.FormDocum­ents.getbyname(sNewDocumentNam­e).open
    Change to:
    oNewFormDocument = ThisDataBaseDocument.FormDocum­ents.getbyname(sNewDocumentNam­e).open
    Notice 'ThisDataBaseDocument' The B in base has to be UPPERCASE for the switch board to work.

  • @allantin009
    @allantin009 Před 11 lety +1

    I would like to ask some questions.
    First, if you could make a video how to create a filter form, a form which has some list-boxes above (like filters )and under those is a table control with some records which are filtered by the list-boxes.
    Second, if you could give some quides about API basic programming language in libreoffice. I "google" it but there is not any basic tutorial about the API only some forums pages in open-office. Do I have to download the sdk .

  • @shanepiper
    @shanepiper  Před 11 lety

    For some reason the LibreOffice Devs never added a hyperlink function in LO Base or OO Base either... hmmm I guess a little bit of basic will have to be written for this then link the macro to a push button.

  • @shanepiper
    @shanepiper  Před 11 lety

    Your welcome.

  • @ianjohnston4018
    @ianjohnston4018 Před 11 lety

    Hi Shane,
    Great video!
    I followed you video and then found I could use a public sub to open any form:
    Public Sub OpenForm(frmName as string)
    oNewFormDocument = ThisDatabaseDocument.FormDocuments.Getbyname(frmName).open
    End Sub
    Then to open a form just pass the form name to the public sub:
    Sub OpenForm1
    OpenForm "Form1"
    End Sub
    now I can open forms from a button without having to remember the correct syntax

  • @ianwhitfield9438
    @ianwhitfield9438 Před 11 lety

    Hi Shane - Tks for your videos - great help!! I've now got my Sub Forms working but can't get this (Button to open Form) working!! I'm using PClinuxOS 2013. LO 4.1.1.2 and MySQL 5.1.55. Has something changed in LO 4 - I can't "see" my macro to be able to select it. Macro Selector - Macro Name remains empty??!!
    Thanks for any help.

  • @Deontjie
    @Deontjie Před 8 lety

    Thanx for this video. I am learning Libra Office because Quattro Pro has become too unstable. But doing the above in Quattro Pro would have been about a 100th of the time. Can somebody combine the power and ease-of-use of Quattro with the stability and price of Libra Office.

  • @shanepiper
    @shanepiper  Před 11 lety +1

    Please explain in a bit more detail as I am unsure what you are asking.

  • @swmckanna
    @swmckanna Před 9 lety

    Thanks for the video! It's very helpful. I still can't get the second form to open when I click the button, however. It will open when I run the macro from Tools>Macros>Run Macro... but not from within the original form. Any ideas?

  • @micmike
    @micmike Před 4 měsíci

    Adding onto what you already have is very different than creating from scratch... Kind a confused here mate!

  • @kroneker2966
    @kroneker2966 Před 11 lety

    Yes!! sorry for my english

  • @ianwhitfield9438
    @ianwhitfield9438 Před 11 lety

    Hi Shane - I replied yesterday but it does not seem to have gone through!! I DO have Macros enabled but this morning found an error in my syntax. I can now "see" my Macro to select it.
    REM ***** BASIC *****
    Sub OpenStoryForm
    const sNewDocumentName = "FedSaintsNew.Story"
    oNewFormDocument = ThisDatabaseDocument.FormDocuments.getbyname(sNewDocumentName).open
    End Sub
    BUT it still does not work - any ideas??

  • @merchan26
    @merchan26 Před 11 lety

    Dear Shane
    Is posible open a form and get to last registred of the tablet association?
    How can I write this?
    Thanks

  • @kroneker2966
    @kroneker2966 Před 11 lety

    Next time can you make a tutorial about how to switch between a Form and an other Document which has a name in a row of the database?

  • @kartibok001
    @kartibok001 Před 11 lety +1

    Hi, thanks for the video. Could you tell me why you used the "s" and "o" in front of New when creating the third macro?
    Cheers

    • @CommanderBalok
      @CommanderBalok Před 3 lety +1

      Microsoft has a notation convention a lot of people use. It says the name of the variable should carry information about the type of data it stores. Thus, 's' commonly begins the names of variables that store strings, and 'o' commonly begins the names of variables that store objects. There are differences of opinion around whether this convention is good or bad.

  • @shanepiper
    @shanepiper  Před 11 lety

    Your welcome :-)

  • @yeya7354
    @yeya7354 Před 7 lety

    Is there a way to get rid of the toolbars when you open up the switchboard?

  •  Před 10 lety +1

    Nice, .... but how to open another form with current record in current form to be shown as current record in newly opened form ???

    • @shanepiper
      @shanepiper  Před 10 lety

      If you want to open another window of information create more thank one set of switch buttons and add a filter.

    • @bdragon254
      @bdragon254 Před 9 lety

      shane piper Thank you sir! Originally I thought making standalone forms / switchboard would be better for my DB, but I just dont like the cons to it. Self contained is much better for me.
      I would also like to implement Krešimir Mihalj 's request into my DB. I have a product DB with a search form. On that form I would like to be able to click a result in the search and have it open that record in my Product Browser form. I will try to get it to work, but I may be asking for your help on that!! :D
      Anyway thanks again for your tutorials! They have been a great help.

  • @shanepiper
    @shanepiper  Před 11 lety

    I can't see anything wrong with the script other than I would check that you have the form name correct.
    const sNewDocumentName = "FedSaintsNew.Story"
    It is CASE sensitive make sure the form you wish to open reads what is in the quotes.

  • @ianwhitfield9438
    @ianwhitfield9438 Před 11 lety

    OK Shane - Tried removing the '.' and no change.
    Still nothing happens!!
    I see an earlier version of LO is on the WebSite - I might try 4.0 tomorrow and see what happens.
    Can we move this to eMail (I still have your address) - stop filling up your site with chit-chat??
    Best regards and I appreciate the help!!

  • @denisayolie
    @denisayolie Před 11 lety

    Thanks for the video, how can i create a drop down menu in form using libreoffice? please help if you know.
    Thanks

  • @tezukakunimitsu4009
    @tezukakunimitsu4009 Před 11 lety

    Sir, i wanna ask how can i open a specific record of another form using buttons?
    Example, i have 2 tables, TableA (w/c contain Name and Team) and TableB (Name and Points). I have 2 forms too, FormA and FormB, in both forms i have 2 records.
    What if I'm in FormA Record2, can i make a button that will open FormB Record2?
    FormA Record3 to FormB Record3? Thanks sir..

  • @TerrorByteTW
    @TerrorByteTW Před 11 lety

    Just a quick question, what OS are you using? This is probably a stupid question

  • @danieldaanna
    @danieldaanna Před 7 lety

    Hi! Thanks for this video. Do you know if this works in standalone forms?

  • @shanepiper
    @shanepiper  Před 11 lety

    If you have any trouble finding the information for opening a file using a macro in OpenOffice or LibreOffice on the net then please let me know.

  • @shanepiper
    @shanepiper  Před 11 lety

    Do you mean a link to a document that is stored on your PC/Server

  • @dykodesigns
    @dykodesigns Před 7 lety +1

    I have libreoffice 5 installed and created a database of my game collection, and I noticed that this works when a form is in the root of the forms list. In version 5, I can create internal folders to organize my forms, but then I get an error message that it can't find the form I want to open. I've already tried entering a path but somehow it doesn't work.
    I have a internal folder called "system overviews", which contains forms like "C64 overviews", "NES overviews", etc. my main form "gamelist" is in the root of the forms list.
    So :
    Sub Open_Gamelist
    Const sNewDocumentName="gamelist"
    oNewFormDocument=ThisDatabaseDocument.FormDocuments.getbyname(sNewDocumentName).open
    End Sub
    Works just fine, since it is the root, but
    Sub Open_C64
    Const sNewDocumentName="/system overviews/C64 overviews"
    oNewFormDocument=ThisDatabaseDocument.FormDocuments.getbyname(sNewDocumentName).open
    and
    Sub Open_C64
    Const sNewDocumentName="\system overviews\NES overviews"
    oNewFormDocument=ThisDatabaseDocument.FormDocuments.getbyname(sNewDocumentName).open
    Don't seem to work. I am using windows, both \ and / give the same fault. It looks like Libre office basic cannot open the form when it is a internal folder, or am I doing something wrong?

    • @shanepiper
      @shanepiper  Před 7 lety

      When I designed the video idid this with Linux. On windows I believe you need to declare the drive letter also. Eg c:/users/yourname/documents/libreofficefiles/c64 if you understand this... Hope it helps.

    • @dykodesigns
      @dykodesigns Před 7 lety

      The folder is internal in the ODB database file itself (created with the gui, using the main menu Insert > Folder), as well as the switchboard. Once the folders are made you can drag items in them to get a more organized layout. I wonder if it is possible to refernce to forms that are stored in these internal folders.

    • @malandruxxx
      @malandruxxx Před 7 lety

      I found out how to do exactly that, please check this code:
      sub OPEN_A_FORM
      const sNewDocumentName="YOUR_FOLDER_NAME_HERE/YOUR_FORM_NAME_HERE"
      oNewFormDocument=ThisDataBaseDocument.FormDocuments.getByHierarchicalName(sNewDocumentName).open
      end sub
      I use Windows, but I think it doesn't have problems with Linux, since it's all internal folders.

  • @megsoconnor3516
    @megsoconnor3516 Před 2 lety

    dont work with last version

    • @shanepiper
      @shanepiper  Před 2 lety

      Hello can I ask which version you are using as I am using 7.1.6-2 Linux Community Edition. Can I ask have you installed JRE? Enabled Macros and set to medium and is your basic syntax correct. Do you get an error message?

  • @shanepiper
    @shanepiper  Před 11 lety

    I think the best thing you can do is take a look at the website forum. openoffice. org

  • @kridtbandit
    @kridtbandit Před 8 lety

    Java must be instalt

    • @shanepiper
      @shanepiper  Před 8 lety

      +Leif Laursen Yes java is installed.

  • @shanepiper
    @shanepiper  Před 11 lety

    Check out this video I recently did I have a drop down box demo in there
    watch?v=jI0lYLFXfgQ

  • @powerinformatica368
    @powerinformatica368 Před 5 lety

    OK : Base LibreOffice 6.3
    Sub CloseFormForm1
    thisDatabaseDocument.FormDocuments.getbyname("Form1").close
    End Sub