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

Button

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


Joined: 30 Aug 2008
Posts: 1

PostPosted: Sat Aug 30, 2008 6:33 pm    Post subject: Button Reply with quote

Hi, it is possible put a button in a form that open an other form to make a kind of menu.

Thanks
Back to top
View user's profile Send private message Send e-mail
Voobase
OOo Advocate
OOo Advocate


Joined: 21 Nov 2007
Posts: 400
Location: Australia

PostPosted: Sat Aug 30, 2008 8:16 pm    Post subject: Reply with quote

Hi there,

Yes it is. You may need to learn how to implement macros to do so. Have a look around for some of the basic tutes. For opening another form, here are some starters for you....

http://www.oooforum.org/forum/viewtopic.phtml?t=70568
http://www.oooforum.org/forum/viewtopic.phtml?t=37999
http://user.services.openoffice.org/en/forum/viewtopic.php?f=39&t=5053
http://www.oooforum.org/forum/viewtopic.phtml?t=63587
http://user.services.openoffice.org/en/forum/viewtopic.php?f=39&t=3185&p=14529&
http://user.services.openoffice.org/en/forum/viewtopic.php?f=39&t=7484
http://www.oooforum.org/forum/viewtopic.phtml?t=72909

Cheers

Voo
Back to top
View user's profile Send private message
valmorel
General User
General User


Joined: 15 Jul 2008
Posts: 35
Location: UK

PostPosted: Sun Aug 31, 2008 5:11 am    Post subject: Reply with quote

This is the code you need. I did not create it myself, I collected it from a forum. The only thing you need to change is YOUR_FORM_NAME in the last line, which you change for the name of the form you wish to open.
You could also change the last line for this one to open a report instead of a form.

NewReportDoc=DBDoc.ReportDocuments.loadComponentFromURL("YOUR_REPORT_NAME","_blank",0,Args())

THE CODE YOU NEED:

Sub OpenForm(Event As Object)
Dim Form As Object
Dim FormDoc AS Object
Dim FormCollection As Object
Dim DBDoc As Object
Dim NewFormDoc As Object
Dim Args(2) As New com.sun.star.beans.PropertyValue

Form=Event.Source.Model.Parent
FormCollection=Form.Parent
FormDoc=FormCollection.Parent
DBDoc=FormDoc.Parent

Args(0).Name="ActiveConnection"
Args(0).Value=Form.ActiveConnection
Args(1).Name="OpenMode"
Args(1).Value="open"
NewFormDoc=DBDoc.FormDocuments.loadComponentFromURL("YOUR_FORM_NAME","_blank",0,Args())

End Sub
Back to top
View user's profile Send private message
rotomano
OOo Enthusiast
OOo Enthusiast


Joined: 13 Dec 2006
Posts: 198
Location: Greece

PostPosted: Sun Aug 31, 2008 5:47 am    Post subject: Reply with quote

Have a look here too:

http://www.oooforum.org/forum/viewtopic.phtml?t=55532


BE sure to read the OObase beginners guide though first from here:
http://documentation.openoffice.org/manuals/oooauthors2/index.html
http://documentation.openoffice.org/manuals/oooauthors2/0110GS-GettingStartedWithBase.pdf
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