Earlier, I had published an article on VBA Combobox & Dropdown List usages (original link: VBA – Combobox and Dropdown List). I had mentioned in that article, that getting the selected value from the Dropdown List was an issue and had provided a workaround for that.
Now, with the guidance of David’s article on this, I have just finetuned this sample. David’s article explains how we can dynamically add Static Text values to a Dropdown List. I derived the idea from the code sample that can be found on this article and the valuable comments entered by Laszlo Neufeld and David’s reply. Do go through David’s article for more details.
Bottomline: We don’t have to worry about writing a lengthy SELECT CASE statement in VBA, whenever we add a new Static Text on to the Dropdown List. The issue that we would face when trying to use Continuum API is that, by default, the dex code that you construct would be executed technically on the standard form. Whatever the field that you have added newly using Modifier will not be accessed from VBA code, unless it is specifically instructed. This trick has been very clearly explained by David in his article. And that’s exactly what I was lacking in my code. By following those instructions, I was able to directly deal with the modifier field whenever a user selects a particular value.
The GL Entry Dropdown List sample can be downloaded from here: VBA & Continuum – Finetuned Dropdown List Sample.
I would like to reiterate what Mariano always use to tell: VBA (combined with Continuum API) is a most powerful and efficient tool for any small scale customizations. We can achieve anything with just pieces of VB and SanScript code. I can’t ask for more, as a GP Developer.
Do go through this sample and get back with your feedbacks.