Hi, I am trying to filter data for a dropdown box using the selection criteria as either a field on the screen, or one from in my program. when I try it, no data is displayed. when I substitute the field name with a constant value, the correct data is displayed.
I checked the thread about "Selection criteria ...' but something i must be doing wrong. please help!!!
Selection criteria for dropdown box, using screen value
-
- Profound User
- Posts: 88
- Joined: Tue Jun 01, 2010 11:31 am
- First Name: christopher
- Last Name: williams
- Company Name: banks dih limited
- Phone: 592-226-9584
- Address 1: thirst park
- Address 2: ruimveldt
- City: gerogetown
- State / Province: Outside Canada/USA
- Zip / Postal Code: 0000
- Country: Guyana
- Contact:
-
- Experienced User
- Posts: 100
- Joined: Tue Feb 21, 2012 1:24 pm
- First Name: Robert
- Last Name: Mullis
- Company Name: WRC
- State / Province: Georgia
- Country: United States
- Contact:
Re: Selection criteria for dropdown box, using screen value
What is the character string in the program field for your selection criteria? I has to be in the same format that you would use in a WHERE clause in SQL. For example, FIELDA = 'ABCDE'.
-
- Profound User
- Posts: 88
- Joined: Tue Jun 01, 2010 11:31 am
- First Name: christopher
- Last Name: williams
- Company Name: banks dih limited
- Phone: 592-226-9584
- Address 1: thirst park
- Address 2: ruimveldt
- City: gerogetown
- State / Province: Outside Canada/USA
- Zip / Postal Code: 0000
- Country: Guyana
- Contact:
Re: Selection criteria for dropdown box, using screen value
it is a numeric field. if I use it like this :- code = 3, it works. if I use it like :-
code = in_Code, it doesn't work. "in_code" being defined exactly the same data type as "code".
code = in_Code, it doesn't work. "in_code" being defined exactly the same data type as "code".
-
- Experienced User
- Posts: 100
- Joined: Tue Feb 21, 2012 1:24 pm
- First Name: Robert
- Last Name: Mullis
- Company Name: WRC
- State / Province: Georgia
- Country: United States
- Contact:
Re: Selection criteria for dropdown box, using screen value
Instead of trying to pull in field in_code into the selection criteria property, define a character field for the selection criteria long enough to hold the complete character string for the selection criteria. Then in your program, load the complete string for the selection crteria into this field you defined for the property.
For example, define a field called SELECT in the selection criteria property that is 20 characters long. In your program, assuming field in_code = 20, you would set field SELECT = 'code = 20'.
For example, define a field called SELECT in the selection criteria property that is 20 characters long. In your program, assuming field in_code = 20, you would set field SELECT = 'code = 20'.
-
- Profound User
- Posts: 88
- Joined: Tue Jun 01, 2010 11:31 am
- First Name: christopher
- Last Name: williams
- Company Name: banks dih limited
- Phone: 592-226-9584
- Address 1: thirst park
- Address 2: ruimveldt
- City: gerogetown
- State / Province: Outside Canada/USA
- Zip / Postal Code: 0000
- Country: Guyana
- Contact:
Re: Selection criteria for dropdown box, using screen value
Hi,
that works just the same as if i had coded it in the selection criteria box. however, when I substitute the "20" with the "in_code" variable, I get the same problem of it now selecting any data.
that works just the same as if i had coded it in the selection criteria box. however, when I substitute the "20" with the "in_code" variable, I get the same problem of it now selecting any data.
-
- Experienced User
- Posts: 100
- Joined: Tue Feb 21, 2012 1:24 pm
- First Name: Robert
- Last Name: Mullis
- Company Name: WRC
- State / Province: Georgia
- Country: United States
- Contact:
Re: Selection criteria for dropdown box, using screen value
You don't put the name of the field into the character string in your program. You take the value of the field and put that in you character string in your program.
For example, in your program:
Then assign field select_string to the selection criteria property in your drop down box.
For example, in your program:
Code: Select all
/Free
in_code = 20;
.
.
.
select_string = 'code = ' + %char(in_code);
/End-Free
-
- Profound User
- Posts: 88
- Joined: Tue Jun 01, 2010 11:31 am
- First Name: christopher
- Last Name: williams
- Company Name: banks dih limited
- Phone: 592-226-9584
- Address 1: thirst park
- Address 2: ruimveldt
- City: gerogetown
- State / Province: Outside Canada/USA
- Zip / Postal Code: 0000
- Country: Guyana
- Contact:
Re: Selection criteria for dropdown box, using screen value
thanks a million. it worked!
-
- Experienced User
- Posts: 100
- Joined: Tue Feb 21, 2012 1:24 pm
- First Name: Robert
- Last Name: Mullis
- Company Name: WRC
- State / Province: Georgia
- Country: United States
- Contact:
Re: Selection criteria for dropdown box, using screen value
Glad I could help.
I am new to ProfoundUI and struggled with a similar situation a couple of weeks ago when trying to dynamically load a subfile grid from a database file with selection criteria. This scenario will work for any widget that is loaded using a database file directly, instead of loading it from the program.
I am new to ProfoundUI and struggled with a similar situation a couple of weeks ago when trying to dynamically load a subfile grid from a database file with selection criteria. This scenario will work for any widget that is loaded using a database file directly, instead of loading it from the program.
Who is online
Users browsing this forum: No registered users and 4 guests