Ask Your Question
1

Use a macro to add a record to a table in Base

asked 2012-08-13 17:04:43 +0200

Anthony P gravatar image Anthony P
13 1 1 4

updated 2012-08-13 20:39:26 +0200

In the database I am making, I have a table "documents" and a table "categories". These two are joined to a third--"documentcategories"--by a primary-foreign key relationship.

On the data-entry form, I want to have a series of checkboxes, one for each category. When the user checks one, I want to add a record to the "documentcategories" table, associating the current documentID with that particular categoryID.

My question: Is this possible to do entirely in the form, or do I have to use a macro? Is it possible to do even with a macro? If so, how would I go about it?

Any help on this is appreciated. -AnthonyP

delete close flag offensive retag edit

Comments

to use SQL in an event-handler macro:

Sub Main(event as object) dim Form,Connection,SQL as object Form = Event.Source.Model.Parent Connection=Form.ActiveConnection SQL=Connection.createStatement() SQL.executeQuery("querey goes here") End Sub

Anthony P ( 2012-08-17 18:15:36 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2012-08-13 18:22:10 +0200

Jacob gravatar image Jacob
16 1

I believe you might only be able to do that in a macro associated with the object. I know Libreoffice uses UNO for extensions, and possibly for macros as well. You might want to look into that.
There is also some interesting looking posts on this forum that may be of some help: http://user.services.openoffice.org/en/forum/viewforum.php?f=20

link delete flag offensive edit

Login/Signup to Answer

Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

Question tools

Follow
1 follower

subscribe to rss feed

Stats

Asked: 2012-08-13 17:04:43 +0200

Seen: 653 times

Last updated: Aug 13 '12