OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Very fundamental problems using macros

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
xpman
General User
General User


Joined: 05 Dec 2008
Posts: 6

PostPosted: Fri Dec 05, 2008 10:49 am    Post subject: Very fundamental problems using macros Reply with quote

Hello everybody;

This is my first post here Very Happy
I've been digging recently into OOo Base after being a very basic user of Calc and Writer, decided to step in into Base to create a very basic Invoicing system . Having 15 years of experience with Oracle products, most of the terminology was familiar to me so I progressed quickly with all the built-in functionality but I'm hitting the wall of needing to use MACROS.

I'm trying to implement the different methods exposed here to update two fields from a combo box but I'm facing two very fundamental problems:
First of all, let me comment I have a form (invoice header) with a sub-form (invoice lines). I'm having the problems on the subform:

1.- Using the simplest macro using an msgbox I've seen that the only events that seem to work are "Before update" "After update" and "Error message" (sorry, I use Spanish version so the translations are on my own). This limits a lot the potential usage of events/macros but still are useable for my purposes.

2.- Macros do no seem to understand "oEv" sintax for elements. A simple call to xRay:

Code:
Xray oEv.source.model


Fails with:
BASIC execution error
Property or method not found

(note Xray is installed and initialized
Do I need to initialize the Macro subsystem in some way?

I'm pretty sure I'll need your help and support to continue, but this hurdle is the main one to start digging into the wonders of the possibilities that the macros open.

Thanks in advance
Back to top
View user's profile Send private message
QuazzieEvil
Super User
Super User


Joined: 17 Jan 2007
Posts: 599
Location: Houston, TX

PostPosted: Fri Dec 05, 2008 11:02 am    Post subject: Reply with quote

Is oEv a parameter in the handler?

can you post a sample event handler
_________________
Free Docs @ http://www.baseprogramming.com/resources.html
Book @ lulu.com http://www.lulu.com/content/2455551
Back to top
View user's profile Send private message Visit poster's website
xpman
General User
General User


Joined: 05 Dec 2008
Posts: 6

PostPosted: Fri Dec 05, 2008 11:38 am    Post subject: Reply with quote

As said I'm a newbie using Macros so don't even know how to check the parameters associated to the handlers. Any help would be greatly appreciated.

As said, I'm left to use "Before update" event as associating a simple macro with just:

Msgbox "Hello world"

proved that only "Before update" and "After update" were able to call the macro.

Maybe that is the very basic problem; all events should work regardless being called from a subform.

Regards
Back to top
View user's profile Send private message
orpheus2
General User
General User


Joined: 27 Nov 2008
Posts: 8

PostPosted: Mon Dec 08, 2008 3:28 am    Post subject: Reply with quote

Hi xpman,

if you want to acces the event structure which is passed to the macro handling your event, then you should declare your macro as follows:

Code:
Sub myComboBox_BeforeUpdate(oEv as Object)
    REM your code here ...
    REM myComboBoxModel = oEv.Source.Model
End Sub


Also the XRay module must be loaded before calling Xray().
Good luck, -orph-
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group