[Solved] >> Macros In Forms

Creating and using forms
Post Reply
williaba
Posts: 55
Joined: Tue Jan 08, 2008 7:05 pm

[Solved] >> Macros In Forms

Post by williaba »

Can someone please help?

I know little about Macros.

Is there any documentation that could be recommended to a novice?

Any books, manuals, etc.

Is the language used in a Macro a flavour of BASIC? If so which one could I use?

Thanks, Brian.
Last edited by williaba on Tue Feb 19, 2008 10:51 am, edited 2 times in total.
User avatar
kabing
Volunteer
Posts: 678
Joined: Fri Nov 23, 2007 12:05 am
Location: Midwest, USA

Re: Macros In Forms

Post by kabing »

One list of resources on macros is available here. While the page is part of the wiki for NeoOffice (an independent Mac port/fork of OpenOffice.org), all the resources listed in the documentation section, except the NeoOffice Guide, are written for OpenOffice.org.

Chapter 10 of the OpenOffice.org User Guide guide covers Macros. It is available on this page.

Finally, there is a section in the OpenOffice.org wiki on BASIC, the most commonly used language for macros.

There may be other resources of which I'm not aware.

kabing
NeoOffice (app store version) OpenOffice.org 4.1 and LibreOffice 4.3 on Mac OS X El Capitan
OpenOffice.org 4.1.2 on Windows 10 (Previously on Vista)
User avatar
DrewJensen
Volunteer
Posts: 1734
Joined: Sat Oct 06, 2007 9:01 pm
Location: Cumberland, MD - USA

Re: Macros In Forms

Post by DrewJensen »

For Basic you can also look at Andrew Pitonyak's documents fount at http://www.pitonyak.org.

Basic however is not the only scripting language available to you. Python, Java Script and Java are also available. There is an implementation of REXX I believe also, however I don't have a link for that just recall hearing about it.

Your title "Macros in Forms". If you are referring to forms that are embedded in an ODB file, this will not be supported starting with OpenOffice.org 3.0 - instead all scripts will be stored at the ODB file level. External script libraries will be supported as they are today, and if you use stand alone Writer or Calc files with form controls then the scripts may be embedded in these files, again as they are today.

I don't think this was mentioned but scripting you will be working mostly with the API to get things done so you will want to use the Developers Guide for this documentation. A copy is included with the Software Development Kit ( SDK ) that can be downloaded from main web site and a current html version of the guide is always available at http://api.openoffice.org/DevelopersGui ... Guide.html.

There are also a couple of tools available to that I find invaluable.
Former member of The Document Foundation
Former member of Apache OpenOffice PMC
LibreOffice on Ubuntu 18.04
williaba
Posts: 55
Joined: Tue Jan 08, 2008 7:05 pm

Re: Macros In Forms

Post by williaba »

Thanks for all the info. It's a lot of info. I'll work through it.

But, in the meantime, may I give you an example of what I would like to do?

The purpose is to input Client data into a table : 'Clients' - via a form.

The form will be a single-entry form with numerous fields pertaining to the client. (Surname, DOB, Address, etc..)

The first entry will be in the 'Client_ID' field, and is unique (the key).

When I enter the Client_ID and hit <Tab> or <Enter> to go to the next field, which would be 'Client_Surname', I want to automatically run a select against the existing data in Table : 'Clients' to see if the Client_ID already exists.

If it does exist, I want to automatically fetch the existing data from the table into all of the fields in the form.

My cursor, focus, remains in the 'Client_ID' field.

Any help would be really appreciated.

Thanks, Brian.
williaba
Posts: 55
Joined: Tue Jan 08, 2008 7:05 pm

Re: Macros In Forms

Post by williaba »

Any comments?
User avatar
DrewJensen
Volunteer
Posts: 1734
Joined: Sat Oct 06, 2007 9:01 pm
Location: Cumberland, MD - USA

Re: Macros In Forms

Post by DrewJensen »

Would zero lines of macro code work.

Open your form - place your cursor in he client ID field - on the data navigator toolbar you will find a button "Form-Based Filter" when you click this all the fields blank out and a small dialog opens with two toolbuttons and a close button - type your client id in the field and click the "Apply filter" tool button on the floating dialog - if a record matches it will automatically be brought into the form - If there is no match the form goes into edit mode with all blank fields and you can simply start entering data for the new record.
Former member of The Document Foundation
Former member of Apache OpenOffice PMC
LibreOffice on Ubuntu 18.04
Post Reply