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

[solved] Opening another form and filtering it

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


Joined: 21 Oct 2010
Posts: 29

PostPosted: Thu Oct 21, 2010 1:57 pm    Post subject: [solved] Opening another form and filtering it Reply with quote

Hi. I'm still having difficulty figuring out OOo Basic (having only used BBC Basic before Wink )

I want to make a button on one Base form that opens another form and filters this newly-opened form. Opening the form is not a problem. However, I don't understand how to refer to the newly-opened form. In the statement below, I need to define "openactivityform" but I don't know how.

Code:
openactivityform.Filter = "Activity code = " & "'" & field.getString() & "'"


I'll be very grateful if anyone can help me to refer to this newly-opened form!

Ed


Last edited by edwardrussia on Sun Oct 24, 2010 11:26 am; edited 1 time in total
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Fri Oct 22, 2010 12:51 am    Post subject: Reply with quote

Hello

Use the Benitez tools

When you open a form then it returns the object for the formdocument.
In the Benitez tools it returns the the object for the data form.

Romke
Back to top
View user's profile Send private message
edwardrussia
General User
General User


Joined: 21 Oct 2010
Posts: 29

PostPosted: Fri Oct 22, 2010 1:09 pm    Post subject: Reply with quote

Thanks for your answer!

Where can I find these tools? Is it totally necessary to download the add-on? If I use it to solve this problem, will all the people I want to use the database also need to download the add-on?

I just want to filter something on the newly opened form.

Please could you explain what "When you open a form then it returns the object for the formdocument." means? What exactly does "return" mean? What object can I use instead of "X" in the code:

Code:
X.Filter = "Activity code = " & "'" & field.getString() & "'"


...to refer to the newly opened formdocument window?

I'm really grateful for any help you can give me.
Back to top
View user's profile Send private message
dacm
Super User
Super User


Joined: 07 Jan 2010
Posts: 769

PostPosted: Fri Oct 22, 2010 3:20 pm    Post subject: Reply with quote

Here's a few threads on the subject:
http://www.oooforum.org/forum/viewtopic.phtml?p=360245#360245
http://www.oooforum.org/forum/viewtopic.phtml?p=390579#390579
http://www.oooforum.org/forum/viewtopic.phtml?p=296409#296409
_________________
Soli Deo gloria
Tutorial: avoiding data loss with Base + Splitting 'Embedded databases'
Back to top
View user's profile Send private message
edwardrussia
General User
General User


Joined: 21 Oct 2010
Posts: 29

PostPosted: Sat Oct 23, 2010 12:08 pm    Post subject: Reply with quote

Thanks for those links, they were really useful. I solved the initial problem of referring to the new formdocument.

However, now I can't get the filter to work properly. I thought I understood the syntax but I'm not sure.

This doesn't work:

Code:
openactivityform.Filter = "'Activity Code' = 'IB1_6.4'"
openactivityform.ApplyFilter = True
openactivityform.Reload


- the other form-document opens with the filter button enabled, but no records visible. When I open the filter navigator, there appear to be no filters.

Thanks again for any help you can give!
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Sat Oct 23, 2010 2:10 pm    Post subject: Reply with quote

Hello

Use double quotes for variables and single quote for literals.

When you need double quotes in a string then you need double double quotes to get one single double quote.

I assume you use the HSQLDB database.

First try in your form to filter what you need then take care that you get those value. You can test this first by printing.

step
1) learn which value you need. Do this by this testing your form and making a filter without macros.
2) Learn in which place.
3) print this value and correct this as long you have not the good values.
4) Assign the value to the filter and test it.

Romke
Back to top
View user's profile Send private message
edwardrussia
General User
General User


Joined: 21 Oct 2010
Posts: 29

PostPosted: Sun Oct 24, 2010 9:33 am    Post subject: Thanks! Reply with quote

Aha! Thanks to your help I've fixed the problem. I'm very grateful!

Ed
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