Ask Your Question

Use a macro to add a record to a table in Base [closed]

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

Anthony P gravatar image

updated 2014-01-07 00:05:20 +0200

oweng gravatar image

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

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2015-10-17 19:06:40.931907


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 gravatar imageAnthony P ( 2012-08-17 18:15:36 +0200 )edit

1 Answer

Sort by » oldest newest most voted

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

Jacob gravatar image

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:

edit flag offensive delete link more

Question Tools

1 follower


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

Seen: 4,771 times

Last updated: Aug 13 '12