Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Getting proper fieldvalue with DrawCommandCLick

edited May 2004 in General
I'd like to allow the end user to click on various fields of a preview
and call up a form that uses the content of the field.

For example, a column may be for sales order no - clicking on any detail
band sales order no dbText field would call up a form displaying
everything about that particular sono.

I don't want to do this with sub-reports.

When I try to use DrawCommandClick, I always get the first record's
value.

How do I determine the "current" (clicked) record's value? I understand
that this is simply a painted "canvas" - but there must be SOME way to
determine the current row...

I saw a previous message here indicating maintaining a TLlist of row
info (or some such) - are there more details or an example available?

Thanks,
EdB

Comments

  • edited May 2004
    Hi Ed,

    I went ahead and created a simple example that should get you on the right
    track. I essentially extracted the text value from the drawcommand once it
    was clicked, then looked up that value in a separate table and retrieved
    information about that record and displayed it in a showmessage call. You
    may not need to use a "lookup" table as I did, I just wanted to separate the
    two to make it easier to understand. Hope this helps.

    http://www.digital-metaphors.com/tips/DrawCommandClickLookup.zip

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2004
    Well that was easy enough... Many thanks!

    If I want to grab two field values at once, I imagine the easiest way may
    be to create a calculated field (i.e. a compound of both individual
    fields) and then parse out the value behind the scenes.

    Any other suggestions on a better way?

    Cheers,
    EdB




    In article <40b5fb01$1@dm500.>, "Nico Cizik \(Digital Metaphors\)"
  • edited May 2004
    Hi Ed,

    In my opinion, the way you describe below is the best way to go about this.
    I find that processing data before generating a report in ReportBuilder
    tends to prevent a lot of headaches :). Good luck.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.