OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Hide/display different subforms based on state of the first?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
DJTJ
Newbie
Newbie


Joined: 23 Feb 2012
Posts: 1

PostPosted: Thu Feb 23, 2012 4:31 pm    Post subject: Hide/display different subforms based on state of the first? Reply with quote

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
View user's profile Send private message
Arineckaig
OOo Advocate
OOo Advocate


Joined: 01 Mar 2004
Posts: 332

PostPosted: Tue Feb 28, 2012 5:24 am    Post subject: Reply with quote

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
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10065
Location: Germany

PostPosted: Tue Feb 28, 2012 6:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group