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] Help! Can I pass a value to a form..

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


Joined: 29 Jun 2010
Posts: 29

PostPosted: Sun Jul 25, 2010 8:03 am    Post subject: [Solved] Help! Can I pass a value to a form.. Reply with quote

Hi,

I'm trying to open a form from a form (using a push button) where I pass a selected value from the first form to use as the trigger for the data displayed on the second form (used for display purposed only and includes a sub form). I had originally planned to use a report for this but I'd have two queries across two tables and can't make it work that way. Can what I am doing instead work?

Thanks all again


Last edited by beginnerAP on Mon Jul 26, 2010 7:09 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: Sun Jul 25, 2010 8:21 am    Post subject: Reply with quote

Hello

Maybe this example can help you

http://user.services.openoffice.org/en/forum/viewtopic.php?f=39&t=26095

Villeroy has make several of this examples.

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


Joined: 29 Jun 2010
Posts: 29

PostPosted: Mon Jul 26, 2010 6:55 am    Post subject: Reply with quote

Hi Romke
Thanks for your response. From your suggestion have made a form based on a query, but as I have two queries have a form and then related subform. I am then using Villeroy's work on SQL and parameters, his example:
Code:

SELECT * FROM "tblSpecies" WHERE ( LOWER ( "English" ) LIKE '%' || LOWER ( :param ) || '%' ) OR ( LOWER ( "Scientific" ) LIKE '%' || LOWER ( :param ) || '%' ) OR :param IS NULL


He uses this in his form to populate a subform and there is a link between the two forms to enable him to get ":param". As I already have my main and sub forms I can't do as he does so wondering is it possible to set the parameter ":param" some way in base??

Just to describe what I am doing. I am working with a form that has a list box e.g. a list of surnames. When someone selects a surname I want to open another form which represents information from a one to many relationship using two queries and a sub form, e.g. showing the parent name and family information on main form from one query and childrens names and ages on the sub form from another query, that looks something like this:
Code:

SELECT "Name", "age" FROM "Children" WHERE ( "Surname" ) LIKE '%' || ( :param ) || '%'

But when I run the code to open the form I have to enter the parameter :param when would like a way to pass the surname selected from the list box to :param.. is this even possible?

Thanks again for your help
Back to top
View user's profile Send private message
beginnerAP
General User
General User


Joined: 29 Jun 2010
Posts: 29

PostPosted: Mon Jul 26, 2010 7:08 am    Post subject: Reply with quote

Ah.. I have it. I've stored the selected value from the list box into a table temporarily and then call that in the SQL.. silly me!

Thanks for the pointer to get me on track though!! Very Happy
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