Van
Posts: 7
|
| Posted: 06/03/2005, 12:42 AM |
|
I have a search grid with a listbox . Value output integer.
I have two edit. grids. Both get the value (ULR parameter) from search grid.
The first edit. grid work with original value from search grid . that's work fine. But the second grid should work with value +10.
I tried it with a hidden field in the search grid with
listbox value +10 and second edit. grid works with calculated hidden field value. But there I have to push two times the search button until the field change come through in output of second grid.
How I can direct define a url (or what ever) parameter source in second edit. grid like "listbox value"+10
Any suggestions are very helpful .
Thx and regards
|
 |
 |
Nicole
Posts: 586
|
| Posted: 06/03/2005, 4:51 AM |
|
Van,
If you’re using search parameter as WHERE parameter you can modify its value in Before Build Select event using code like
form_name.DataSource.Parameters("url<param_name>") = new_value
If you utilize this value in events code, then just use CCGetParam() function to obtain parameter’s value.
_________________
Regards,
Nicole |
 |
 |
Van
Posts: 7
|
| Posted: 06/03/2005, 7:51 AM |
|
Nicole,
sounds very easy , but I have no idea where I have to change what.
The first step I added to the listbox of search grid as Before Build Select event .
But how I have to handle your second step ?
Can you describe it more detailed ?
Thx and best regards
|
 |
 |
tecolotemx
|
| Posted: 06/03/2005, 9:48 AM |
|
Here is an advice
<<The first edit. grid work with original value from search grid . that's work fine. But the second grid should work with value +10.
Well, you receive a original value from the grid, because on the "data source" you have a Where Contidition. If you edit this contidition you´ll see something like " id_URL ={id_URL} " . If you edit this option you´ll see something like this:
Name: id_URL
contidion: equals (=)
Parameter source: id_URL
Well, the Param var has the integer value of your URL . Maybe you can simple add +10.
It would look like this:
Parameter source : cDbl(id_URL) + cDbl(10)
if you oly do a "id_URL + 10" you will get string of characters that will finish on 10. The cDbl will do a math add.
I hope this will be useful.
|
|
|
 |
Van
Posts: 7
|
| Posted: 06/05/2005, 3:51 AM |
|
I tested 1000 combinations without success =(
I describe it more detailed:
search grid with name "tb_data_rosterSearch"
search conditions:
control source type: code expression
DataSourceType : List of values
my relevant Listbox has the name "no":
Set noDataSource = CCCreateDataSource(dsListOfValues, Empty, Array( _
Array(1, 10, 19, 28, 37), _
Array("01 - 09", "10 - 18", "19 - 27", "28 - 36", "37 - 45")))
the first edit. grid (name "tb_data_roster") takes value "no" for a stored procedure
Data source for stored procedure parameter:
stored procedure parameter | Parameter Source
Name: @no | no
DataType: int | URL
first edit. grid works fine !!
the second edit. grid (name "tb_data_roster2") should takes value "no" +10 for a stored procedure
Data source for stored procedure parameter:
stored procedure parameter | Parameter Source
Name: @no | no + 10
DataType: int | URL
I tested Parameter Source :
cDbl(no) + cDbl(10) | URL
cDbl("no") + cDbl(10) | URL
cDbl("urlno") + cDbl(10) | URL
CCGetParam("no"+10, Empty) | Expression
CCGetParam("urlno"+10, Empty) | Expression
CCGetParam(cDbl(no) + cDbl(10), Empty) | Expression
nothing works !
I tried also Before Build Select event
tb_data_rosterSearch.DataSource.Parameters("urlno") = 10
CCGetParam("no", Empty) | Expression
or
dim mmm
mmm = tb_data_rosterSearch.DataSource.Parameters("urlno") +10
tb_data_rosterSearch.DataSource.Parameters("urlno") = mmm
error messages or no results. =(
Can anybody describe it detailed on my issue for my understanding?
Thx and regards
|
 |
 |
Nicole
Posts: 586
|
| Posted: 06/06/2005, 2:23 AM |
|
Van,
You really can try to use Expression type parameter source. But as for me your code is incorrect. Why do you convert result to double if parameter type is set to Integer? Use CInt() instead of CDbl(). Add 10 to result of CCGetParam().I have and idea about the expression, however I’m not sure that it works. But you can try! 
CInt(CCGetParam("parameter_name", 0)) + CInt(10)
_________________
Regards,
Nicole |
 |
 |
Van
Posts: 7
|
| Posted: 06/06/2005, 4:09 AM |
|
Nicole thx a lot, your solution works.
I used double because I have no plan =).
a hour ago I found also a way over your first suggestion:
Before Build Select:
form_name.DataSource.Parameters("url<param_name>") = form_name.DataSource.Parameters("url<param_name>") +10
Parameter Source URL <param_name>
your last solution is smarter
thx a lot again
|
 |
 |
|