Hello again,
Sorry I was so long on this - had to do something else first and never got to
that backup - so I just now wrote a quick script for you.
The actual Basic sub procedure is:
sub UpdateFormName( oEvent as object )DIM sOldTitle as stringDIM oDBFormFrame
as variantDIM offset as integer
oDBFormFrame = thisComponent.CurrentController.Frame sOldTitle =
oDBFormFrame.Title offset = InStr(sOldTitle, "(" ) if offset <> 0 then
oDBFormFrame.Title = left( sOldTitle, offset - 1 ) end ifend sub
How to use it. Open OO.org and from the main menu select
Tools>Organize Macros>OpenOffice.org BasicThis opens the Basic dialog. On the
left of the dialog box is a list titled "Macro from".
Select My macros and expand it.
Now you will see a basic library named "Select", expand it.
Now you have a module inside the library named "Module1"
Select this and click on Edit.
The basic editor will open with Module1 from the Standard library loaded in it.
Copy the sub procedure from above and past it into the editor after the last
line of the
default Main procedure.
Save and close the basic editor.
Now open your form in edit mode. Not for data entry in other words.
Right click on the table grid control and on the context menu select "Form"
The dataform control's property editor dialog opens.
This dialog has three tabs. You want to select the tab "Events"
On the Events tab you will see an event named "When loading"
All the way to the right of the line is a small button with "..."
Click on this and another dialog opens, "Assign action"
Click on the button "Macro"
On this dialog there are two lists "Library" and "Macro name".
Just as before on the Library list you
Expand My Macros, expand Standard and select Module1
Now in the Macro name list there should be two items
"Main" and "UpdateFormName"
Select UpdateFormName and click on OK
The Assign Action dialog is on top again, click OK
Close the Property Editor dialog
Save the form and close it.
Save your database file.
Open the form the normal way and the title should
now be changed to only the name of the form.
You can reuse this sub procedure with any forms your
create in the future.
I know that there is no explanation of why with this email..sorry.
If you want to go over that I will be happy to do so.
HTH
Drew
>-----Original Message-----
>From: Drew [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, September 19, 2007 06:10 PM
>To: [email protected]
>Subject: Re: [dba-dev] OO 2.3 Base "form" view says "read-only"-- But it's
>not
>
>Hi Swarup,
>
>ROFL - that again! ( sorry nothing to do with you, it is just a question that
>gets asked A LOT!!! in the forum )
>
>That is an artifact of the decision to base the embedded Base forms on Writer
>documents.
>
>That is telling you the 'document' is read only - in other words you can not
>move the controls around or edit their properties. The data link is not read
>only - well, unless of course it is...*smile*..in that case certain of the
>buttons on the data navigator bar would be disabled.
>
>Think of it as a feature. If it is a feature you do not like, then changing
>the title of the form, so as not to display that and perhaps to display
>something more useful is actually quite easily done, with 3 lines of Basic. (
>maybe it is 5 )
>
>I'll grab the code and put it up here - with a simple description of how to
>use it.
>
>I won't be long - just have to pull it out of a backup file - long story about
>installing Community Version of Solaris on the second hard disk of a HP
>PC....arrrgh...that has no place here...arrrgh... Live and Learn.
>
>Drew
>
>>-----Original Message-----
>>From: Dinbandhu [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, September 19, 2007 05:41 PM
>>To: [email protected]
>>Subject: Re: [dba-dev] OO 2.3 Base "form" view says "read-only"-- But it's
>>not
>>
>>Hello Drew (and others),
>>
>>You had recommended me to start using the "forms" view rather than the
>>"table" view for data input and review. In OO 2.2 I had found that the
>>forms wizard would not finish its work of creating a form, and upon
>>reporting this on this list, was recommended to upgrade to OO 2.3. I
>>have done so, and now the forms wizard works wonderfully.
>>
>>My only question at this time, is that, although the "forms" view
>>appears to allow for data input just fine, but it states at the top of
>>the form "read-only". Is it just an error that this appears there, or is
>>there some significance to it?
>>
>>Thanks,
>>Swarup
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>