Products A-Z All Services Can't find what you're looking for? Chat Live!
Products A-Z Can't find what you're looking for? Chat Live!
Can't find what you're looking for? Chat Live!
Hi .. I would like to "lock down" the Constit and Gift ID'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 "lock down" the field (view only) in the before_open event or alternately is there a way to access the "previous" values of these fields that can be used to overwrite the field on the before_save event. Thx nigel
Nigel,
I don't know how to make the field read only, but maybe this work to restore it when the record is saved:
Dim an array at the VBA module level with two columns per row, and, say, 10 rows.
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.
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.
Using an array indexed by the Import ID instead of just a variable lets you have several constituent records open at one time
Hope this helps! Stu Pattison, WCPE-FM Radio.
Stu,
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't have to worry about global variables colliding or being overwritten. I have included the code below for others. Thx Nigel