New form opening in same window

Creating and using forms
Post Reply
wdlyons
Posts: 2
Joined: Sun Dec 07, 2008 11:01 pm

New form opening in same window

Post by wdlyons »

Hi,
I am trying to create a switchboard to open form in the database I am currently building using push buttons

I have used the following code (which I found on this dusussion board) with success but the forms open in a new window.

Code: Select all

Sub OpenForm(Event As Object) 
   Dim Form As Object 
   Dim FormDoc AS Object 
   Dim FormCollection As Object 
   Dim DBDoc As Object 
   Dim Args(1) 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" 

   DBDoc.FormDocuments.loadComponentFromURL("EMPLOYEES","_blank",0,Args()) 
End Sub 
I would like to know how I can make the forms open in the original window used by the switchboard. Is this possible and if so can you please advise what changes I need to make to the macro?

Thanking you in advance

Warwick
OOo 3.0.X on Ms Windows XP
User avatar
Hagar Delest
Moderator
Posts: 33397
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: New form opening in same window

Post by Hagar Delest »

I see you haven't had any reply for a month, so I move your topic in the Form section of the forum.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE Faye) and 24.8 portable on Windows 11.
Post Reply