| View previous topic :: View next topic |
| Author |
Message |
xpman General User

Joined: 05 Dec 2008 Posts: 6
|
Posted: Fri Dec 05, 2008 10:49 am Post subject: Very fundamental problems using macros |
|
|
Hello everybody;
This is my first post here
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 |
|
 |
QuazzieEvil Super User

Joined: 17 Jan 2007 Posts: 599 Location: Houston, TX
|
|
| Back to top |
|
 |
xpman General User

Joined: 05 Dec 2008 Posts: 6
|
Posted: Fri Dec 05, 2008 11:38 am Post subject: |
|
|
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 |
|
 |
orpheus2 General User

Joined: 27 Nov 2008 Posts: 8
|
Posted: Mon Dec 08, 2008 3:28 am Post subject: |
|
|
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 |
|
 |
|