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

Modify/Search mode of a form

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


Joined: 14 Oct 2007
Posts: 14

PostPosted: Sun Oct 14, 2007 11:45 am    Post subject: Modify/Search mode of a form Reply with quote

Just created my first usable database, it is an addressbook.

It contains a main table with names, phone numbers and so on. One of the fields is for references (keys) to another table which contains cities.

My main form contains a table control which shows some entries of the main table, and a list box for the city of the selected record of the table control/main table. What I can do so far with this form is to modify my main table.

What I would like to do now, is including a check box "Modify" which changes the functionality of the form: if it is checked, the function shall be as described above. If unchecked, modification of the database shall be disabled, and the city listbox shall serve as selector of the records displayed in the table control.

How do I do that?
Back to top
View user's profile Send private message
QuazzieEvil
Super User
Super User


Joined: 17 Jan 2007
Posts: 599
Location: Houston, TX

PostPosted: Mon Oct 15, 2007 1:57 pm    Post subject: Reply with quote

here is an example on toggeling the allow delete, insert, and update of a form
Code:

Sub toggleFormAccess(Event As Object)
   Dim Form As Object
   Form=Event.Source.Model.Parent
   
   Form.AllowUpdates=Not(Form.AllowUpdates)
   Form.AllowDeletes=Not(Form.AllowDeletes)
   Form.AllowInserts=Not(Form.AllowInserts)
   Form.reload()
End Sub

you can set them all, or just the one you want. you must reload the form for the edits to take effect.
you can save the current row: CurrRow=Form.Row and reset it after the reload: Form.absolute(CurrRow) as you will be taken to the first record whenever you reload.

hope this helps.
Back to top
View user's profile Send private message Visit poster's website
hreba
General User
General User


Joined: 14 Oct 2007
Posts: 14

PostPosted: Mon Oct 15, 2007 3:56 pm    Post subject: Reply with quote

Thanks, will try it.
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