<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.blackbaud.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>VBA/API</title><link>http://forums.blackbaud.com/forums/20.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Debug Build: 20611.960)</generator><item><title>Re: Does anyone know how to locking down Constit ID using System Macro ?</title><link>http://forums.blackbaud.com/forums/thread/35751.aspx</link><pubDate>Wed, 17 Sep 2008 16:39:19 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:35751</guid><dc:creator>Nigel Henriques</dc:creator><slash:comments>0</slash:comments><comments>http://forums.blackbaud.com/forums/thread/35751.aspx</comments><wfw:commentRss>http://forums.blackbaud.com/forums/commentrss.aspx?SectionID=20&amp;PostID=35751</wfw:commentRss><description>&lt;p&gt;Stu,&lt;/p&gt;
&lt;p&gt;The use of an array would work in the Before_Open event with matching on the Import ID in the Before_Save event. Blackbaud support supplied me with some code that allows you to load the currently stored record which can be accessed in the Before Save event routine. It works perfectly and we don&amp;#39;t have to worry about global variables colliding or being overwritten. I have included the code below for others. Thx Nigel&lt;/p&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;oRecord&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : record object being saved&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;bCancel&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : set to true to cancel the save operation&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oConstituent As CRecord&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oRORecord As CRecord&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oDO As IBBDataObject&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; On Error GoTo ErrHandler&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oConstituent = oRecord&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not oConstituent Is Nothing Then&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;bCancel = &amp;lt; place your custom save criteria here &amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oDO = oRORecord&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If oDO.FieldIsDirty(ERECORDSFields.RECORDS_fld_CONSTITUENT_ID) Then&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oRORecord = New CRecord&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; With oRORecord&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.Init oSessionContext&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Load oRecord.Fields(ERECORDSFields.RECORDS_fld_ID), True&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oConstituent.Fields(RECORDS_fld_CONSTITUENT_ID) = oRORecord.Fields(RECORDS_fld_CONSTITUENT_ID)&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Closedown&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oRORecord = Nothing&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oConstituent = Nothing&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; On Error GoTo 0&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#1f497d;mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Does anyone know how to locking down Constit ID using System Macro ?</title><link>http://forums.blackbaud.com/forums/thread/34074.aspx</link><pubDate>Tue, 09 Sep 2008 23:22:21 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:34074</guid><dc:creator>Stu Pattison</dc:creator><slash:comments>0</slash:comments><comments>http://forums.blackbaud.com/forums/thread/34074.aspx</comments><wfw:commentRss>http://forums.blackbaud.com/forums/commentrss.aspx?SectionID=20&amp;PostID=34074</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Nigel,&lt;/p&gt;&lt;p&gt;I don&amp;#39;t know how to make the field read only, but maybe this work to restore it when the record is saved:&lt;/p&gt;&lt;p&gt;Dim an array at the VBA module level with two columns per row, and, say, 10 rows.&lt;/p&gt;&lt;p&gt;In the Before_Open event for a Constituent record, find a blank row in the array, then set the cell in first column of the row to the import ID of the record and the second cell to the original Const ID.&amp;nbsp; &lt;/p&gt;&lt;p&gt;Then, in the Before_Save event, find the row with the matching import ID, restore the Const ID from the second cell of the row, then blank that row in the array.&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Using an array indexed by the Import ID instead of just a variable lets you have several constituent records open at one time&lt;/p&gt;&lt;p&gt;Hope this helps! &amp;nbsp; Stu Pattison, WCPE-FM Radio. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Does anyone know how to locking down Constit ID using System Macro ?</title><link>http://forums.blackbaud.com/forums/thread/34029.aspx</link><pubDate>Tue, 09 Sep 2008 17:50:19 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:34029</guid><dc:creator>Nigel Henriques</dc:creator><slash:comments>0</slash:comments><comments>http://forums.blackbaud.com/forums/thread/34029.aspx</comments><wfw:commentRss>http://forums.blackbaud.com/forums/commentrss.aspx?SectionID=20&amp;PostID=34029</wfw:commentRss><description>&lt;p&gt;Hi .. I would like to &amp;quot;lock down&amp;quot; the Constit and Gift ID&amp;#39;s assigned by RE and would like to know the best of of accomplishing this via a VBA system macro. Is there a way to &amp;quot;lock down&amp;quot; the field (view only) in the before_open event or alternately is there a way to access the &amp;quot;previous&amp;quot; values of these fields that can be used to overwrite the field on the before_save event. Thx nigel&lt;/p&gt;</description></item></channel></rss>