Hiding the Source code In Modified Forms

Hi,

We used Modifier and VBA to modify some forms is Great Plains (Rel 7.0). New 
text boxes and labeles were added to the form and custom code has also been 
written. After modifying the forms, we exported the same into a package. This 
was then imported at the client's place using the Customization Maintenance 
option and the modified forms were installed. However, we find that when some 
error occured in the modified forms, the control opens the code window and 
comes to the line in the code where the error has occured and the all the 
code that we have written is visible.  We have written necessary error 
handling routines in the code.

What we need to know is, is there any way we can prevent the display of  
code we have written in the modified forms ? Currently the code is written 
inside the form  under various events. 

Thanks

Rajendran Menon


0
Menon1 (17)
9/8/2005 5:06:02 AM
greatplains 29623 articles. 6 followers. Follow

5 Replies
583 Views

Similar Articles

[PageSpeed] 57

In my experience, the code should never show unless:

- you have an unhandled VBA error
- you have a compile-time error

If you leave VBA to deal with any errors it encounters, the user will be 
given the opportunity to view your code.

If you don't want that handle every error. You don't need to do anything 
(although obviously you should be doing something) - just don't let VBA's 
default error trap handle it or it will give the user the option to view your 
code.




"Menon" wrote:

> Hi,
> 
> We used Modifier and VBA to modify some forms is Great Plains (Rel 7.0). New 
> text boxes and labeles were added to the form and custom code has also been 
> written. After modifying the forms, we exported the same into a package. This 
> was then imported at the client's place using the Customization Maintenance 
> option and the modified forms were installed. However, we find that when some 
> error occured in the modified forms, the control opens the code window and 
> comes to the line in the code where the error has occured and the all the 
> code that we have written is visible.  We have written necessary error 
> handling routines in the code.
> 
> What we need to know is, is there any way we can prevent the display of  
> code we have written in the modified forms ? Currently the code is written 
> inside the form  under various events. 
> 
> Thanks
> 
> Rajendran Menon
> 
> 
0
YCI (25)
9/8/2005 9:37:09 PM
You may also password protect the code so even though VBA window opens,
they won't see the code and won't be able to change it by accident.

0
rrs1977 (140)
9/9/2005 3:49:11 AM
Thanks for the information. We will try this out
-- 
Rajendran Menon



"YCI" wrote:

> In my experience, the code should never show unless:
> 
> - you have an unhandled VBA error
> - you have a compile-time error
> 
> If you leave VBA to deal with any errors it encounters, the user will be 
> given the opportunity to view your code.
> 
> If you don't want that handle every error. You don't need to do anything 
> (although obviously you should be doing something) - just don't let VBA's 
> default error trap handle it or it will give the user the option to view your 
> code.
> 
> 
> 
> 
> "Menon" wrote:
> 
> > Hi,
> > 
> > We used Modifier and VBA to modify some forms is Great Plains (Rel 7.0). New 
> > text boxes and labeles were added to the form and custom code has also been 
> > written. After modifying the forms, we exported the same into a package. This 
> > was then imported at the client's place using the Customization Maintenance 
> > option and the modified forms were installed. However, we find that when some 
> > error occured in the modified forms, the control opens the code window and 
> > comes to the line in the code where the error has occured and the all the 
> > code that we have written is visible.  We have written necessary error 
> > handling routines in the code.
> > 
> > What we need to know is, is there any way we can prevent the display of  
> > code we have written in the modified forms ? Currently the code is written 
> > inside the form  under various events. 
> > 
> > Thanks
> > 
> > Rajendran Menon
> > 
> > 
0
Menon1 (17)
9/9/2005 4:12:03 AM
Thanks for the information. 
-- 
Rajendran Menon



"VJ" wrote:

> You may also password protect the code so even though VBA window opens,
> they won't see the code and won't be able to change it by accident.
> 
> 
0
Menon1 (17)
9/9/2005 4:13:01 AM
No problem. A little more detail as I have a bit more time right now - 

All you really need it do is use the "Compile <Project>" option in the VBA 
IDE menu on the code before you export it. That will rule out any 
compile-time errors (syntax, etc).  If you have a compile time error in the 
code your users run, the user will be automatically be shipped to your code 
where it failed (sounds like what you described).

To deal with VBA run-time errors, you just need to put an error handler in 
every single procedure/event you write code in. If not, the user will get an 
option to "debug" which will then bring them to the code in question.

If you don't have complex code, this is pretty simple. While I'm really 
against using On Error Resume Next, you can just pop that into every 
procedure/function/event with custom code in it. It's dangerous, but for 
simple customizations and a quick and easy (and dirty way) to solve your 
problem.  

Do the above two things and the user should never see your code. 

Or as the other fellow mentioned, use the password protection feature. 
However (and I'm just guessing here) I think you'll need to intentionally 
trigger an unhandled VBA error in your client server (if they dont have the 
VBA/modifier keys) to access the VBA onsite and set those properties. I doubt 
the password protection is "exportable". Otherwise, you can update the client 
site by doing a binary copy of the vba files from yoru dev, which would carry 
forward project properties.

Personally, I'm not a fan of this kind of thing unless you're the only 
person who will support the client. It's easy for someone else to misplace, 
forget or otherwise be unable to access the VBA when time is of the essence. 

"Menon" wrote:

> Thanks for the information. We will try this out
> -- 
> Rajendran Menon
> 
> 
> 
> "YCI" wrote:
> 
> > In my experience, the code should never show unless:
> > 
> > - you have an unhandled VBA error
> > - you have a compile-time error
> > 
> > If you leave VBA to deal with any errors it encounters, the user will be 
> > given the opportunity to view your code.
> > 
> > If you don't want that handle every error. You don't need to do anything 
> > (although obviously you should be doing something) - just don't let VBA's 
> > default error trap handle it or it will give the user the option to view your 
> > code.
> > 
> > 
> > 
> > 
> > "Menon" wrote:
> > 
> > > Hi,
> > > 
> > > We used Modifier and VBA to modify some forms is Great Plains (Rel 7.0). New 
> > > text boxes and labeles were added to the form and custom code has also been 
> > > written. After modifying the forms, we exported the same into a package. This 
> > > was then imported at the client's place using the Customization Maintenance 
> > > option and the modified forms were installed. However, we find that when some 
> > > error occured in the modified forms, the control opens the code window and 
> > > comes to the line in the code where the error has occured and the all the 
> > > code that we have written is visible.  We have written necessary error 
> > > handling routines in the code.
> > > 
> > > What we need to know is, is there any way we can prevent the display of  
> > > code we have written in the modified forms ? Currently the code is written 
> > > inside the form  under various events. 
> > > 
> > > Thanks
> > > 
> > > Rajendran Menon
> > > 
> > > 
0
YCI (25)
9/9/2005 9:43:04 PM
Reply:

Similar Artilces:

setting form record source when form is opened
I have a question about setting the record source of a form at the time the form is opened. Background: I need to clean up and modify an application. The application currently only has one table and one template form for data entry. However a separate copy of a selection query and a separate copy of the data entry form have been created for each analyst in the office. The only difference between the queries is the CurrentAnalyst criteria is set to one person’s name. The only difference between the forms is the record source is set to a different selection query. Currently the analysts o...

From switchboard
On my switchboard I have three choices. Enter in Data, Edit current record, Run report. The Edit Currrent Record pulls up a previously entered record via query parameter. My question is do I need to make a copy of my Data Entry (new record) form for this Edit? The macro or command or whatever asks which form to pull up when setting switchboard. Does it pose a problem if either choice pulls up the same form? You can use the same form. Typically, there're different considerations depending on whether your making a new entry (record) into your database or editing an existing entry, so you m...

FORM MAIL IN OUTLOOK
Hi, I have this code in a html page <form name="form1" method="post" action="xxx@xxx.xxx?subject=RICHIESTA ISCRIZIONE&body=xxxx"> <input type="submit" name="Submit" value="SEND"> </form> This code is only used by 2 computers. The first is running Windows Xp SP2 with Office outlook 2002 no sp. With this computer when i press the send button on form, outlook opens a window with the mail but doesn't send it. (what I want) The second is running Windows Xp SP2 with Office outlook 2003 No sp Whit this computer ...

Organize spreadsheet of sales leads by zip code?
Please help... I need to organize a spreasheet by zip code. Not only do all of the zip codes need to go together that are alike, but then the zip code next to it needs to match up with the actual geographic location. This way maps can be generated for daily routes for the salesman. Please Please help! ...

Assistanec with Code much appreciated
Can someone write me a wee snippit of VBA which I can attach to a button. I would like to be able to click a button with would run a filter on Column N in my spreadsheet. The result of the filter would show all entries which began with the letter J and ended with the letter N. It would also show all entries which do not begin with J but do end in Y. For info, the entries in column N are no more than a dozen letters and no spaces exist. Many thanks Gerry You could use a helper column to decide whether or not these conditions are true (or false) and filter on true. =OR(AND(LEFT(n2,1)=&q...

modifying text within word 2007 document
Okay, here is what I am trying to do in Word 2007. I have finished writing a large amount of text with minimal formatting (page numbers and caps and fonts, spacing, etc). I would like to accomplish the following: I want to select all this text and have numbered lines appear to the left (far left margin) as, say, an archaic legal deposition might retain. I do not want to disturb the text formatting (font, spacing, etc.). I used to do this task quite easily in Word Perfect yet I cannot find this feature with Word. All help is greatly appreciated. Okay I think I {self} discovered t...

How to print a blank form for data-entry purpose?
I want to print a blank form for data entry purpose. If the form is totally blank, nothing prints out (except for label on top of form). To solve this problem I input a simple character in one field, which is not a wise solution. Is there a better way to print blank form? And more, in numerical fields, a zero appears. I want this zero not to appear in print. How can do this? Rasoul Khoshravan wrote: > I want to print a blank form for data entry purpose. If the form is > totally blank, nothing prints out (except for label on top of form). > To solve this problem I input a simple cha...

Count number of checked boxes on a form
I would like to add a textbox (txtCheckedForms) that shows the number of checkbox fields are checked on a form. Is there a simple way of doing this? The only thing I've come up with so far is something like this... If chkField1 = True then varCheckedForms = varCheckedForms + 1 if chkField2 = True then varCheckedForms = varCheckedForms + 1 .... ifchkField50 = True then varCheckedForms = varCheckedForms + 1 txtCheckedForms = varCheckedForms The problem is, I have about 50 checkbox fields on my form. That would take a long time and a lot of space! Also, the fields aren't actually ...

Date Modified sort issue.
Good afternoon. The issue is that when I sort (right-click --> arrange icons by --> Modified or click on the Date Modified header), it sorts by Date Modified, but categorizes by the Name (Folders, Shortcuts, Files. etc.). I was wondering if anyone knew of a way to sort an entire folder (either ascending or decending) by Date Modified. Thank you, WHEELS -------- Original-Nachricht -------- > Good afternoon. > > The issue is that when I sort (right-click --> arrange icons by --> Modified > or click on the Date Modified header), it sorts by Da...

MSIL code
Hi! I just wonder about this Reflector tool. If I made a dll in .NET can then a person that have this DLL look at all the source code by using the Reflector tool ? I mean can he/she recreate all the source code. If I instead have a DLL unmanaged code for example made in C++ is it here possible look at the source code by using some kind of tool. I mean something that remind of Reflector ? //Tony Since .NET programs and libraries are compiled to MSIL, basically yes. Anyone can use .NET Reflector to view your source code almost as you wrote it. You can use various tools (D...

Macro debug is referring to other macro code
I have a file I created in Excel 2003, but in Excel 2000 when some of the macros are run they give a Debug error....However, when you open the debug window the line of code being referred to is in a different macro to the on that should be running.... For example - On one sheet I have a combo box and a couple of command buttons....In Excel 2003 everything works as it should.... However, in Excel 2000 the combo box works fine, but when you click either of the command buttons it gives the following run time error '1004' -Select Method of Range class failed When you hit debug the line ...

Changing Previously Entered City Zip Codes
I have a customer who has entered incorrect cities and state abbreviations that are tied to zip codes. This false information keeps coming up by default when he enters the zip codes. Is there a way to change this? I thought entering a new city and state to correspond with the correct zip code when creating a new customer would rectify this, but it again reverts to the originally and incorrectly entered zip, city, and state. Thanks for your time. The way this funtionality works, is it reads the first available record that matches the entered ZIP code. Therefore if you have been e...

regarding form preparation
i am designing a form in excel. i want only maximum one character/letter to be entered in a particular cell and once it is entered, cursor/active cell shifts to adjacent cell. i tried data validation, it helps in restricting maximum text length to one but i am not able to shift cursor/active cell to adjacent cell. -- Sumit ------------------------------------------------------------------------ Sumit's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=29520 View this thread: http://www.excelforum.com/showthread.php?threadid=492207 ...

Data Form/Dialog Box
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I would like to create a dialog box for my expense report. <br><br>My company has a spreadsheet they like me to use...but I loath moving cell to cell to enter my data. <br><br>I would like to create a dialog box or data form (not sure of correct terminology) that I can enter the data in (date, $$, choose category...etc) and have it land in the expense report. Even adding additional rows if necessary. <br><br>I tried the Data>Forms function...but wanted something a bit more...

Using a calendar in a form
Hello, I work on an app in VBA/Access, and I would like to use a MS calendar control to allow the user to select a date. But when I use the calendar with : calDate.Value = Now() I found the that calendar is set on today year and month (October 2007), and with the day (29) selected. What I would like is to have the calendar set on October 2007, but with no day selected. Is this possible ? How can it be done ? Thank you for your help. On Oct 29, 11:28 am, nartla <bruno.bar...@altran.com> wrote: > Hello, > > I work on an app in VBA/Access, and I would like to use a MS cal...

pasting screendump picture in VBA form
Ik would like to paste screen dump pictures in excel only showing the VBA form to the user. Of course it's possible to paste directly in a sheet but i don't want people to use the excel sheet itself, only the VBA form. Is there a object i can use for this purpose? regards Roy ...

How to disable Small alphabet letters on the form
I know the code to disable the small alphabet letters on form. I have to write on each form indiviually. Is there any method that i can set the code globally when the mdb is started the small alphabet letter is disabled and the user can only type the capital letter on the all the Forms Please advise. Regards Irshad =?Utf-8?B?SXJzaGFkIEFsYW0=?= <IrshadAlam@discussions.microsoft.com> wrote in news:4D97999E-8093-40F8-A7C7-128B7325037D@microsoft.com: > I know the code to disable the small alphabet letters on form. > I have to write on each form indiviually. Is there any method...

form fields navigation in Word 2003
I've created a form for a client. I used several text form fields and put in some default text.Then I protected the form. I then navigate to my form fields using tab. My field then gets highlighted. BUT, when I start to type the default text is just pushed forward. It doesn't get overwritten. Even though I had the entire field highlighted. I keep navigating using tab. I never click anywhere. It still happens just like that. I opened a new document and recreated it. Same result. I then moved over to my computer. Here it works like it should. So I know how to do it right. Th...

Continuous Forms subform referenced by subform
Hello, I have a form, frmRates with a list box and two subforms, subRatesA and subRatesB. The first subform, subRatesA has a default view property of “Continuous Forms”. It gets its data using a query Record Source that filters based on the list box pick. SELECT tblAcct5_HotelRatesLookUp.hotel_id, tblAcct5_HotelRatesLookUp.rate_code, tblAcct5_HotelRatesLookUp.hotel_status, tblAcct5_HotelRatesLookUp.include_exclude_flag, tblAcct5_HotelRatesLookUp.FromDate, tblAcct5_HotelRatesLookUp.ToDate, tblAcct5_HotelRatesLookUp.Rate, tblAcct5_HotelRatesLookUp.country, tblAcct5_HotelRat...

Can I create custom forms to add data to a Excel Spreadsheet? How.
see this site http://www.contextures.com/excelfiles.html#UserForm it has a sample WB that you download. good online instructions. >-----Original Message----- > >. > ...

Complex numbers in polar form.
Does Excel support mathematical equations in polar form? Also, is there a function set for AC circuits? You will need to do all the math using normal complex numbers in the form a+ib You will need to work out functions using Excel's trig functions Try a more specific question -- Bernard Liengme www.stfx.ca/people/bliengme remove CAPS in e-mail address "lz" <anonymous@discussions.microsoft.com> wrote in message news:BD888270-2E82-473A-BF8C-14CC5C4C5B8F@microsoft.com... > Does Excel support mathematical equations in polar form? Also, is there a function set for AC circ...

mail folder: modify view
When I create a new custom mail folder view for "all mail folders", my specified view is not remembered correctly in other mail folders. Is this a known issue? Is there a work-around? In an Outlook Inbox sub-folder, I go to... 1: Customize Current View menu item 2: "Custom View Organizer" dialog box opens 3: I create a new table-based mail folder view named "New view" and I select "on all mail and post folders" 4: I click button "Apply View" 5: my custom view is applied as expected 6: I immediately go to another sub-folder a...

Set the Source of the Report at Runtime
Hi I wonder how can I set the source of the report at runtime so when I call the report the correct query will be called Thank you, Samuel Samuel wrote: > Hi > > I wonder how can I set the source of the report at runtime so when I > call the report the correct query will be called That would usually be done in the Open event of the report. That code would examine *something* and from that decide what the RecordSource should be. The something could be controls on an open form, a global variable, values in a table, etc.. The key line of code would be... Me.RecordSource...

IMAP server closed the connection, Error Code: 0x800CCCDD
I frequently get the error message: Your IMAP server closed the connection. This can occur if you leave the connection idle for too long. Lost mailbox lock Protocol: IMAP Server: ahsmail.uwaterloo.ca Port: 143 Error Code: 0x800CCCDD. I get my mail but it is very annoying to have to close the dialog box all the time. Is there a way around this? Sounds like your ISP closes the IMAP connection after receiving the NOOP command from Outlook. Since you can't configure Outlook to stop sending this command, perhaps your ISP will reconfigure their server to not cl...

how 2 create form letters with fill-in boxes 4personal words?
form letter template. need to learn how to create fill-in boxes [grey in color] to personalize by adding information, fill in, when writing many letters. Where do I look to learn? You could use form fields (see http://word.mvps.org/FAQs/Customization/FillinTheBlanks.htm and especially the forms tutorials by Dian Chapman that this article links to), but I think for a letter you would require something more readily editable, in which case perhaps you want MacroButton fields; see http://word.mvps.org/FAQs/TblsFldsFms/UsingMacroButton.htm. OTOH, if you're creating "form...