This topic is locked

HOW TO SET A DEFAULT VALUE FOR A FIELD ON SEARCH PAGE

9/28/2009 4:26:44 PM
ASPRunnerPro General questions
C
Conrunner author

Hi there

Using ASPRunner Pro
For some time now I have been trying to figure out how to query multiple charts using just one search page as we don't have dashboard functionality at present. I have 2 tables

RESULTS and RESULTSSEARCH

The Results Table is the table all the charts look at and I want to search this table by Month and Year. Therefore the query that would be passed to all the charts would be Select * from RESULTS where Month = x and Year = y.
Rather than having to type this in on all the search pages for all of the individual graphs however I thought that the "search page" to apply the search criteria to all of the graphs could actually be an ADD page for the second table RESULTSSEARCH. Therefore an individual would type in the Month and the Year into this add page and then this data would be entered to RESULTSSEARCH.
Then, I thought that I could set the default value for Month and Year on each of the search pages for the graphs to equal the value of Month and Year in the RESULTSSEARCH table. In order to set a default value however the default value should be a "valid ##SCRIPT## expression" but I don't know how to do this.
Is this possible and can anyone help?
How do I set the default value for Month and Year on all of the search pages for the graphs to equal the values in Month and Year in RESULTSSEARCH? (This RESULTSSEARCH table will only ever contain one record (containing the current search terms) because once the search has been performed I plan to use an update query to delete this record, so that RESULTSSEARCH table is empty until the next search).
Many Thanks

Con.

J
Jane 9/29/2009

Con,
use Search page: Before display event to pre-populate fields on the advanced search page.

Here is just a sample:

dim var1

Set rstmp = dal.RESULTSSEARCH.QueryAll()

var1 = rstmp("FieldName1")

doArrayInArrayAssignment control_FieldName1,"params","value",var1

rstmp.close

set rstmp=nothing
C
Conrunner author 9/29/2009

Hi Jane

Thanks

I have tried this but get the error
Microsoft VBScript compilation error '800a0401'

Expected end of statement

/output/include/ResultsSAMPLE_events.asp, line 40

dim var1Set rstmp = dal.RESULTSSEARCH.QueryAll()var1 = rstmp("FieldName1")doArrayInArrayAssignment control_FieldName1,"params","value",var1rstmp.closeset rstmp=nothing

------------^
I have tried entering various Field names but to no avail. What text in this snippet you have provided do I need to change to suit my own application?
Con.

J
Jane 9/30/2009

Hi,
you need to repalce FieldName1 with your actual field name.

If it doesn't help publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.