Manolis Christodoulou wrote:
I work with a ODB document which has some forms. I need a macro on one form that opens another form from the same ODB file. I can not figure out how to do it. Please help.

Thank you.


I have the following OOo Basic code laying around. I don't know how well this particular version of it works because I haven't worked with the database it was in in a while. Someone else can probably do a little more with it. I can't right now. Time for bed.

function OpenForm( formContainer as variant, oConnection as variant, sFormName as string) as variant
        Dim aProp(1) As New com.sun.star.beans.PropertyValue
        
        aProp(0).Name = "ActiveConnection"
        aProp(0).Value = oConnection
        aProp(1).Name = "OpenMode"
        aProp(1).Value = "open"
        OpenForm = 
formContainer.loadComponentFromURL(sFormName,"_blank",0,aProp())
end function

function getFormsTC() as variant
        getFormsTC = thisComponent.Parent.getFormDocuments
end function

function getConnectionTC() as variant
        getConnectionTC = thisComponent.Drawpage.Forms(0).ActiveConnection
end function

--
WalterAM
http://walteram.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to