Results 1 to 2 of 2

Thread: Can I use the return from MyFunc(CellValue) for field value?

  1. #1
    Steven Overson Guest

    Can I use the return from MyFunc(CellValue) for field value?

    I want to take the value in a field, pass it into a function, and then have it displayed in the grid. I have tried to make this work in the SQL statement and using magic MagicCell. For example…

    SQL method:

    MyDB.DbSQL="SELECT " _
    & "RecID, " _
    & "MyFunc(Price) AS MyPrice, " _
    & "Status " _
    & "FROM PriceTable " _
    & "WHERE RecID =" & Session("vb_RecID&#34

    But the Access 97 ODBC driver doesn't like this, so I tried…

    MagicCell method:

    MyDB.DbSQL="SELECT " _
    & "RecID, " _
    & "Price, " _
    & "Status " _
    & "FROM PriceTable " _
    & "WHERE RecID =" & Session("vb_RecID&#34
    MyDB.dbMagicCell=&#34;1,,<A HREF=&#34;&#34;view.asp?rID=#0#&#34;&#34;>MyFunc(# 1#)</A>,index&#34;

    But this just produces a cell value of &#34;MyFunc(1000)&#34; where Price = 1000. I try taking my function out of the string as follows:

    MyDB.dbMagicCell=&#34;1,,<A HREF=&#34;&#34;view.asp?rID=#0#&#34;&#34;>&#34; & MyFunc(#1#) & &#34;</A>,index&#34;

    But this generates scrip errors because out of the string &#34;#1#&#34; doesn&#39;t mean anything. I hope you can see the direction I am going…

    So, is there a way to take the value of a field, pass it into a function, and use the value returned from the function as the field value?

    Thanks for your brain cycles on this,

    Steven

  2. #2
    Frank Guest

    Can I use the return from MyFunc(CellValue) for field value? (reply)

    Steven,
    At the moment, there is no provision for user to perform MagicCell like operations in cell values. Please describe what exactly are you trying to do with the cell value that MagicCell didn&#39;t cover at this time ? There are extended MagicCell capabilities in V2 in the area of logical operations. I want to make sure your cell conversion in not included.

    Frank


    On 11/6/98 5:40:01 PM, Steven Overson wrote:
    > I want to take the value in a field, pass it into a function, and then have
    > it displayed in the grid. I have tried to make this work in the SQL
    > statement and using magic MagicCell. For example…

    SQL
    > method:

    MyDB.DbSQL=&#34;SELECT &#34; _
    & &#34;RecID, &#34; _
    &
    > &#34;MyFunc(Price) AS MyPrice, &#34; _
    & &#34;Status &#34; _
    &
    > &#34;FROM PriceTable &#34; _
    & &#34;WHERE RecID =&#34; &
    > Session(&#34;vb_RecID&#34

    But the Access 97 ODBC driver doesn&#39;t
    > like this, so I tried…

    MagicCell method:

    MyDB.DbSQL=&#34;SELECT
    > &#34; _
    & &#34;RecID, &#34; _
    & &#34;Price, &#34; _
    & &#34;Status
    > &#34; _
    & &#34;FROM PriceTable &#34; _
    & &#34;WHERE RecID =&#34; &
    > Session(&#34;vb_RecID&#34
    MyDB.dbMagicCell=&#34;1,,<A
    > HREF=&#34;&#34;view.asp?rID=#0#&#34;&#34;>MyFunc(# 1#)</A>,index&#34;

    But
    > this just produces a cell value of &#34;MyFunc(1000)&#34; where Price =
    > 1000. I try taking my function out of the string as
    > follows:

    MyDB.dbMagicCell=&#34;1,,<A
    > HREF=&#34;&#34;view.asp?rID=#0#&#34;&#34;>&#34; & MyFunc(#1#) &
    > &#34;</A>,index&#34;

    But this generates scrip errors because out of the
    > string &#34;#1#&#34; doesn&#39;t mean anything. I hope you can see the
    > direction I am going…

    So, is there a way to take the value of a field,
    > pass it into a function, and use the value returned from the function as
    > the field value?

    Thanks for your brain cycles on this,

    Steven

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •