OK found the form name from the properties page.
Then:
oObj=ThisComponent.DrawPage.GetForms()
oForm=oObj.getbyName("MainForm") 'index(0) also works on GetByIndex
print oForm.name 'verifies all is OK
o=findform(oForm,"txtTest")
According to AndrewBase.odt, the findform function should find all the
controls on a form if the input is a form. The routine does find the
form "MainForm" if the input object is set to the DrawPage. But at
runtime, the above fails on the findform line with the message "Object
variable not set" at the calling stage (breakpoint set on the line).
Any thoughts?
Cheers,
Jim Gardner
Andrew Douglas Pitonyak wrote:
Jim Gardner wrote:
Hi:
First posting. Reasonable experience in VBA and Microsoft Office, now
migrating to OOo to avoid those continual upgrade problems with
different versions of Access. Bit of a steep learning curve with
plenty of Googling. Successful reprogramming of an Excel application
to Calc. Currently want to migrate from Access to OOoBase.
The problem: I have a form "test" generated by the Wizard, showing
the database fields. I want a mouse leaving event to make other
controls visible/non visible, but to do that I need the control and
form objects. Andrew Pityonak's book was very helpful for Calc but
doesn't cover Base and I can't find code examples for this on the
web. I've tried the code examples in AndrewBase.odt for getting
controls and forms by name using the form name "test" and the names
of the controls on the form layout (after ungrouping the label and
control) but the return is always empty. I'm probably missing
something in the application object name. Any help appreciated.
Cheers,
Jim Gardner
Try this:
http://www.pitonyak.org/database/
or, more specifically,
http://www.pitonyak.org/database/AndrewBase.odt
It is not really the best document for forms, but it at least
discusses a few things about them (such as how to obtain controls and
such).
http://www.oooforum.org/forum/viewforum.phtml?f=10
Look at the sticky posts near the top!
We are in the "talking" stage with respect to Base documentation at
the authors web site. That said, I believe that there is a chapter on
"Using Forms in Writer" that may be at least somewhat applicable, but
I have not read it.
http://documentation.openoffice.org/manuals/oooauthors2/index.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]