I had a case today that raised an issue that I have seen before which has a simple solution.
The Problem
In summary, when you add a field to Visual Basic from Microsoft Dynamics GP, the name of the field is set to the text in the the linked prompt for that field (or the caption text for buttons). If there is no linked prompt, the name of the field is set to the name of the Dexterity field (with any spaces removed). There is a problem when that field name is the same as a Visual Basic for Application (VBA) keyword or reserved word.
A couple of really common examples are the Date field and the Print button, where Date and Print are reserved words in VBA. When you attempt to use those fields, they are interpreted as the reserved word command and not a field name. Unlike SQL Server which can surround the field with [square brackets], there is no method to force VBA to use the keyword as a field.
I did some background research and did find a couple of Knowledge Base (KB) articles which refer to the same issue.
The Solution
To demonstrate the issue and the solution, here are a series of screenshots.
After changing a field name, just make sure that any code written now references the updated name for the field and everything will work as expected.
Hope this helps.
David
Posting from Mark Polino at DynamicAccounting.net
msdynamicsgp.blogspot.com/.../quick-tip-using-fields-named-as.html
PLEASE READ BEFORE POSTING
Please only post comments relating to the topic of this page.
If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.