This topic is locked

Drop Down Box value conditioned by making it to

12/23/2005 8:10:32 PM
ASPRunnerPro General questions
Alberto author

Sergey: We a need to make a dropdown to depend on a field that is NOT a dropdown box.
In this case the field is the key of a details table and its value comes from the corresponding master previewsly selected.
Try 1:

I used "This dropdown is dependant on" and I have selected the field that contains the value for the condition and it works ok only in Editmode, when I use Add the key field showed that is loaded automatically with GetRequestForm("masterkey") brings the value between ' (single quotes) so does not match and therefore does not populate the combo.
Try 2:

I used the where expresion to condition the combo values with "TableFieldName = '" & GetRequestForm("masterkey") & "'" but get an error
I know that this may not be intended to work like this but due to the needs and looking to get more from ASPRunner...and it seems to be very close to work.

How could we acomplish this utilising ASPRunner Sergey?
Thanks

Sergey Kornilov admin 12/26/2005

You cannot make dropd-down box dependent on control other than another drop-down box.
Where clause you trying to use looks correct. What is exact error message you getting.
Try to print SQL query generated by this drop-down box and make sure it looks right.

Alberto author 12/26/2005

Sergey, please find here details about my laborious test. I hop it can help to solve the problem.

=====================================================================

[color=#000000](TRY 2)

When I used: "[ECID] = '" & GetRequestForm("masterkey") & "'"

Wrong SQL statement is obtained as follows.

sqlt = "SELECT [Tabla] FROM [dbo].[tbStrategiesJoin] WHERE [Tabla] = " & strData & " and " & "[ECID] ='" & GetRequestForm("masterkey") & "'" (By the way it is acording the help found in where expression)
After Fixing it by using: "[ECID] = " & GetRequestForm("masterkey") I get the next results per mode page:

List

Microsoft VBScript runtime error '800a01a8'

Object required: 'myRequest'

/prod/strategies/include/tbStrategiesCriteria_aspfunctions.asp, line 1755
Edit

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

ODBC driver does not support the requested properties.

/prod/strategies/include/tbStrategiesCriteria_aspfunctions.asp, line 870
Add

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

ODBC driver does not support the requested properties.

/prod/strategies/include/tbStrategiesCriteria_aspfunctions.asp, line 870
Copy

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

ODBC driver does not support the requested properties.

/prod/strategies/include/tbStrategiesCriteria_aspfunctions.asp, line 870
View

Microsoft VBScript runtime error '800a01a8'

Object required: 'myRequest'

/prod/strategies/include/tbStrategiesCriteria_aspfunctions.asp, line 1755
-----------------------------------------------------------------------------------------------------------------------------

HOWEVER I FOUND THIS OTHER POSIBILITY
"[ECID] = " & strMasterKey

List

Microsoft VBScript runtime error '800a01a8'

Object required: 'myRequest'

/prod/strategies/include/tbStrategiesCriteria_aspfunctions.asp, line 1755
Edit

Looks OK
Add

Looks OK
Copy

Looks OK
View

Microsoft VBScript runtime error '800a01a8'

Object required: 'myRequest'

/prod/strategies/include/tbStrategiesCriteria_aspfunctions.asp, line 1755
=====================================================================
AT THE END WHEN I TRY USING COMBO BOX DEPENDING ON THE KEY FIELD IT WORKS ALMOST PERFECT AS FOLLOWS

List

Looks OK
Edit

Looks OK
Add

[color=#FF0000]Shows the Box Empty having the right value in the key field
Copy

Looks OK
View

Looks OK
Pretty close ha? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=7224&image=1&table=forumreplies' class='bbc_emoticon' alt=':unsure:' />

Sergey Kornilov admin 12/27/2005

GetRequestForm() function won't work on pages other than EDIT and ADD.
Here is what you can do to simplify this schema.

  1. When you proceed to Details List page save master key value in Session variable.

Session("MasterKey") = Request("masterkey")


2. Set WHERE clause of dropdown box to

"[ECID] = " & Session("masterkey")
Alberto author 1/4/2006

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=7314&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> That is why we were not wrong when choosing ASPRunner.
The Product: Is good and if there is anything that does not work in the way we need, some how there is a reasonable road to solve it and sometime becomes a new feature too.
The Support: Always a good attitude find out and to keep going in the right direction.
Thanks Sergey.
PD. I finally got it working, following your sugestions I found that using Session(strTableName & "MasterKey") works as great as needed.

A
ashumak 1/5/2006

I think my problem is some how related to what you are talking about. My error is on edit and add. I link a managers name to a reps name, but not sure what to use as the where tsatement. Any idea's where to look for help?
Alan

Alberto author 1/5/2006

Alan, please describe a litle bit more what is your problem or what do you need to do...
WHERE statement is good for example to condition what values to show in the combobox. Therefore you need to know the condition it should match then think how to place it in the WHERE feature. What is the condition in your case?
I my case I needed to show only values related to the masterkey of that record.

A
ashumak 1/10/2006

In my case I am linking the values of a sales reps name to that of the manager. when the reps name is entered, the managers name should auto load in the proper drop down. problem is , some times it works, some times it doesn't.
Alan

Alan, please describe a litle bit more what is your problem or what do you need to do...

WHERE statement is good for example to condition what values to show in the combobox. Therefore you need to know the condition it should match then think how to place it in the WHERE feature. What is the condition in your case?
I my case I needed to show only values related to the masterkey of that record.


In my case I am linking the values of a sales reps name to that of the manager. when the reps name is entered, the managers name should auto load in the proper drop down. problem is , some times it works, some times it doesn't.
Alan

Alan, please describe a litle bit more what is your problem or what do you need to do...

WHERE statement is good for example to condition what values to show in the combobox. Therefore you need to know the condition it should match then think how to place it in the WHERE feature. What is the condition in your case?
I my case I needed to show only values related to the masterkey of that record.

Sergey Kornilov admin 1/11/2006

Alan,
please zip and send to support@xlinesoft.com a full set of generated ASP files alogn with database file or database creation script.

I'll find what's wrong with your project running it on my test box.

A
ashumak 1/11/2006

Already done. One change I am making is changing Now() to Date() as this might be part of a problem. One concern is that some additions seem to go MM/DD/YYYY for dates added, and others end up DD/MM/YYY....
Alan

Alan,

please zip and send to support@xlinesoft.com a full set of generated ASP files alogn with database file or database creation script.

I'll find what's wrong with your project running it on my test box.

M
mcolnaghi 8/30/2008

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=32580&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> That is why we were not wrong when choosing ASPRunner.

The Product: Is good and if there is anything that does not work in the way we need, some how there is a reasonable road to solve it and sometime becomes a new feature too.
The Support: Always a good attitude find out and to keep going in the right direction.
Thanks Sergey.
PD. I finally got it working, following your sugestions I found that using Session(strTableName & "MasterKey") works as great as needed.


I had the same problem and solved reading this post. But... in the new version (i use 5.2) the right syntax is:

Session(strTableName & "_MasterKey1") where "1" is the first master-detail relationship I had (just one in my case).