<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : [WKND] Determine ReportRecordItem from Click Event</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : [WKND] Determine ReportRecordItem from Click Event]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 15 May 2026 11:07:26 +0000</pubDate>
  <lastBuildDate>Tue, 23 Jun 2009 20:43:26 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=14581</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[[WKND] Determine ReportRecordItem from Click Event : It turns out to be a bit trickier...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14581&amp;PID=50246&amp;title=wknd-determine-reportrecorditem-from-click-event#50246</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 14581<br /><strong>Posted:</strong> 23 June 2009 at 8:43pm<br /><br />It turns out to be a bit trickier than mentioned above because clicking markup UI elements does not change the focus to the record of the item you clicked. You will need to move the focus yourself in your markup event. So:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>Private Type POINTAPI<br>&nbsp;&nbsp; x As Long<br>&nbsp;&nbsp; y As Long<br>End Type<br><br>Private Declare Function GetCursorPos Lib "user32.dll" (ByRef lpPoint As POINTAPI) As Long<br>Private Declare Function ScreenToClient Lib "user32.dll" (ByVal hwnd As Long, ByRef lpPoint As POINTAPI) As Long<br><br>Public Sub EditComments(Reserved1 As Object, Reserved2 As Object)<br>&nbsp;&nbsp; ' This sub is called by a markup object Click event for example.<br>&nbsp;&nbsp; Dim lo_Hit As ReportHitTestInfo<br>&nbsp;&nbsp; Dim lt_Mouse As POINTAPI<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; GetCursorPos lt_Mouse&nbsp;&nbsp; 'Get mouse pointer in screen coordinates<br>&nbsp;&nbsp; ScreenToClient Me.ReportControl1.hwnd, lt_Mouse&nbsp;&nbsp; ' Convert screen coords to coords relative to ReportControl position<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; Set lo_Hit = Me.ReportControl1.HitTest(lt_Mouse.x, lt_Mouse.y)&nbsp; ' Determine what report item the mouse is over<br>&nbsp;&nbsp; If Not lo_Hit Is Nothing Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Not lo_Hit.Row Is Nothing Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Me.ReportControl1.FocusedRow = lo_Hit.Row&nbsp;&nbsp;&nbsp;&nbsp; ' Set the focus to the row that the mouse is over<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; ' Do whatever you need to do here &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br>&nbsp;&nbsp; End If<br>&nbsp;&nbsp; <br>End Sub<br></pre></td></tr></table><br>]]>
   </description>
   <pubDate>Tue, 23 Jun 2009 20:43:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14581&amp;PID=50246&amp;title=wknd-determine-reportrecorditem-from-click-event#50246</guid>
  </item> 
  <item>
   <title><![CDATA[[WKND] Determine ReportRecordItem from Click Event : Sometimes just asking the question...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14581&amp;PID=50143&amp;title=wknd-determine-reportrecorditem-from-click-event#50143</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 14581<br /><strong>Posted:</strong> 20 June 2009 at 1:32pm<br /><br />Sometimes just asking the question can help you think of the answer. I can assume that the focused row is the one where the button was clicked and get the record from there in my click event sub:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>Me.ReportControl1.FocusedRow.Record<br></pre></td></tr></table><br><br>]]>
   </description>
   <pubDate>Sat, 20 Jun 2009 13:32:47 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14581&amp;PID=50143&amp;title=wknd-determine-reportrecorditem-from-click-event#50143</guid>
  </item> 
  <item>
   <title><![CDATA[[WKND] Determine ReportRecordItem from Click Event :   I&amp;#039;m using Markup events...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14581&amp;PID=50142&amp;title=wknd-determine-reportrecorditem-from-click-event#50142</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 14581<br /><strong>Posted:</strong> 20 June 2009 at 1:27pm<br /><br />I'm using Markup events in ReportRecordItem captions, and everything is working great so far. For example, I have a number of rows and in each cell of one column I have a button that when clicked will call a sub in my VB6 form. <br><br>My question is, is there any way to determine the ReportRecordItem for the clicked markup button without having to provide unique subs for each button click event? I'm creating my records dynamically based on drag &amp; drop, so multiple subs doesn't seem like a good option.<br><br>Thanks.<br>]]>
   </description>
   <pubDate>Sat, 20 Jun 2009 13:27:52 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14581&amp;PID=50142&amp;title=wknd-determine-reportrecorditem-from-click-event#50142</guid>
  </item> 
 </channel>
</rss>