You are in the right direction !
You need to create a macro, and then assign it to an event in the event
tab. A good event is the "on mouse released"
You will need to write the macro yourself, assign it a name, save it in
the document [check the OO user guide on how to create and save macros
in a document]
and then select the macro in the events tab after clicking on the button
you want to assign it to.
Here is a macro-code you can use:
replace the name FORM_TO_OPEN at the bottom with the form you would like
the macro to open upon pressing the relevant button. (can work with
queries and reports)
REM ***** BASIC *****
Sub Main
End Sub
Sub openForm(x$)
Dim prop(1) as New com.sun.star.beans.PropertyValue
prop(0).Name="ActiveConnection"
prop(0).Value=ThisComponent.Parent.DataSource.getConnection("","")
prop(1).Name="OpenMode"
prop(1).Value="open"
ThisComponent.Parent.FormDocuments.loadComponentFromURL(x$,"_blank",0,prop())
End Sub
Sub openForm_FORM_TO_OPEN
openForm("FORM_TO_OPEN")
End Sub
Mister wrote:
Hi there
I teach a high school final year computer science course and have
decided to use oobase 2.4.x as most of my kids do not have MS Access.
I have managed to work out most of the things I require but I have
hit a brick wall. I need to set up a front end form which will have
buttons leading to various existing forms for data entry purpose. I have tried
numerous ways of executing this but each fail.
I created a button and by double clicking on the button a pop up
appeared which either gave me options in the actions field (none of
which appeared valid) or I went to the events tab which asked for
macros. I tried to create a macro to open an existing form but it
would not allow me to do that. I have gone through all of the built in
macros and cannot spot one which will allow me to open an existing form using a
button in another form.
I am willing to accept that I am missing something or doing something
wrong – but I do need help. I have searched the Internet and cannot
find any resolution to this.
Can any of you help me with a site or a tutorial which can talk me through this?
Regards from Down Under
Mike Ross
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]