| View previous topic :: View next topic |
| Author |
Message |
beginnerAP General User

Joined: 29 Jun 2010 Posts: 29
|
Posted: Sun Jul 25, 2010 8:03 am Post subject: [Solved] Help! Can I pass a value to a form.. |
|
|
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 |
|
 |
RPG Super User

Joined: 24 Apr 2008 Posts: 2696 Location: Apeldoorn, Netherland
|
|
| Back to top |
|
 |
beginnerAP General User

Joined: 29 Jun 2010 Posts: 29
|
Posted: Mon Jul 26, 2010 6:55 am Post subject: |
|
|
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 |
|
 |
beginnerAP General User

Joined: 29 Jun 2010 Posts: 29
|
Posted: Mon Jul 26, 2010 7:08 am Post subject: |
|
|
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!!  |
|
| Back to top |
|
 |
|