Hi,
I've got a problem with a form I created with OoBase version 3.
Programming language : Basic.
I've created a form wich contains dynamic sections : Sections that can
target different files (and different sections in these files) in
function of the current entries. (type and subtype of an equipement)
Those sections contain data store in database. The same filter is used
outside and inside the sections in order to see what must be shown.
My problem is as follow :
When I load the form, the sections are correctly loaded and contains the
right datas.
But then, when I change the entry option, the sections change but the
link to the database seems to be destroy.
I don't understand how we can refresh the link without coming back to
the previous state of the sections
I've tried things like :
- oForm.reload()
or
- oSection.SetPropertyValue("isAutomaticUpdate", True)
But those functions have the side effect that my sections are coming
back to the previous states.
If someone can help me... you will find bellow the two subs I use to
change the sections
Thanks in advance,
SCHIEHLE Adrien
Here are the two simple Sub I use to change sections.
##############################################################################################
rem~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'LinkSection : Link a subsection of the targetted file to the section
rem~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub LinkSection(oDoc As Object, aSectionName As String, aLinkRegion As
String)
Dim oSection As Object
oSection = oDoc.GetTextSections.GetByName(aSectionName)
If oSection.GetPropertyValue("LinkRegion") <> aLinkRegion Then
oSection.SetPropertyValue("LinkRegion", aLinkRegion)
End If
End Sub
##############################################################################################
rem~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'LinkSectionFile : Link a file to the section
rem~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub LinkSectionFile(oDoc As Object, aSectionName As String, aFileLink As
String)
Dim oSection As Object
Dim vFileLink As New com.sun.star.text.SectionFileLink
oSection = oDoc.GetTextSections.GetByName(aSectionName)
' If oSection.GetPropertyValue("FileLink") <> aFileLink Then
vFileLink.FileURL = aFileLink
vFileLink.FilterName = "writer8"
oSection.SetPropertyValue("FileLink", vFileLink)
' End If
End Sub
##############################################################################################
Those subs are called when the entry options change. Depending of the
change I call only 'LinkSection' or the two subs.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]