| View previous topic :: View next topic |
| Author |
Message |
DJTJ Newbie

Joined: 23 Feb 2012 Posts: 1
|
Posted: Thu Feb 23, 2012 4:31 pm Post subject: Hide/display different subforms based on state of the first? |
|
|
I'm trying to find a tutorial that would explain how to do the following sort of thing with forms...
Basically IF field #1 contains x THEN display input #3 ELSE display input #4
Lets say input #1 is a combo box and you can choose from two options. If you choose option one, an additional field that accepts an arbitrary text string appears. If you choose option #2 then a couple additional fields appear that only accept date/time. (just an example).
any help would be appreciated. |
|
| Back to top |
|
 |
Arineckaig OOo Advocate

Joined: 01 Mar 2004 Posts: 332
|
Posted: Tue Feb 28, 2012 5:24 am Post subject: |
|
|
Welcome to the forum and I am sorry that you have not already received a reply.
It might be possible to help if one had a better understanding of what you are aiming for. The title of the thread refers to sub-forms whereas your post appears to be directed to the visibility of fields. It would help, also, if you were to outline the relevant parts of the structure of your database and how these relate to the task. _________________ When this issue has been resolved, it helps other users of the forum if you add the word [Solved] to the Subject line of your 1st post (edit button top right).
OOo 3.4.1 and MySQL on MS Windows XP and Ubuntu |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Tue Feb 28, 2012 6:54 am Post subject: |
|
|
Untested Basic code for the subform's reloading event:
| Code: | Sub form_reloaded(ev)
frm = ev.Source
b = frm.isFirst()
m = frm.getControlModels()
For i = 0 to uBound(m)
ctrl = m(i)
ps = ctrl.PropertySetInfo
if ps.hasPropertyByName("EnableVisible" then ctrl.EnableVisible = b
Next
end sub
|
_________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
|