After using the DIM I get a
BASIC Syntax Error. Expected:,.
This is line 15
DIM aFormStart() = Split(thisComponent.Title, thisComponent.UntitledPrefix)
Is there a way around the Option Explicit for this kind of macro?
I have 8 forms that are listed in the list box from a table of form names.
This list box will be on each of the 8 forms for navigation between the forms.
This is a CRM type database I am creating. I am almost done if I can get this part working correctly.
Since it was in German I ran it thru a translator and I think it came out right but this is what I have now.
Option Explicit
Sub Menu_Click(oEvent)
Dim sFormToOpen As String
sFormToOpen = oEvent.Source.SelectedItem
If sFormToOpen = “none” Then
Exit Sub
Else
ThisDatabaseDocument.FormDocuments.getbyname(sFormToOpen).open
End If
End Sub
SUB To_form_from_form(oEvent AS OBJECT)
DIM stTarget AS String
DIM aFormStart() = Split(thisComponent.Title, thisComponent.UntitledPrefix)
stTarget = oEvent.Source.Model.Tag
ThisDatabaseDocument.FormDocuments.getByName( Trim(stTarget) ).open
ThisDatabaseDocument.FormDocuments.getByName( Trim(aFormStart(1)) ).close
END SUB