Welcome to Forums Sign in | Join | Help | Forums
in Search


Forms

Last post 06-13-2008 4:44 AM by David Zeidman. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-11-2008 7:45 PM

    • Jim Hannum
    • Not Ranked
    • User Since: 2005
    • Posts 5
    • Organization: Grand Chapter of California Order of the Eastern Star
    • Products:  The Raiser's Edge

    Forms

    I am creating a macro for entering a new individual consitutent. Unfortunately the only reference I have found so far to Forms in the RE VBA esentials guide is on page 98, where it indicates that "VBA provides full-featured forms design support", where I "can design a custom data entry form". It does not however, explain how to do this. After much reseach, trial, and error I have found that I must start the macro with the following code in the module named "User_Macros":

    Public Sub AddNewMember()

        Load frmNewMembers
        frmNewMembers.Show

    End Sub

    Where "AddNewMember" is the name of the macro. Now my macro is being terminated as follows:

    Private Sub cmdExit_Click()

        moCodeTablesServer.Closedown
        Set moCodeTablesServer = Nothing
       
        End
       
    End Sub

    This is taking place in the form, not in the original User_Macro module. The "Closedown" and "Nothing" lines are to shut down the Code Tables Server that I am using to load a combo box -- it took me quite awhile to figure out how to do this also, especially since there was an error in the sample code. But I am wondering if I am going to end up with any memory leaks from not unloading the form? Is this done automatically as part of the "End" statement? I cannot figure out how to return to the original code and unload the form.

    Filed under: ,
  • 06-12-2008 5:13 PM In reply to

    • David Zeidman
    • Top 25 Contributor
    • User Since: 2002
    • Posts 326
    • Organization: Zeidman Development
    • Products:  Blackbaud Direct Marketing, Blackbaud Enterprise CRM, The Information Edge, The Raiser's Edge

    Re: Forms

    Jim,

     You should not use the key word 'End'. This is really quite obsolete and kills everything.

    In the cmdExit_Click() method you should hide the form. i.e. me.hide or you could put Unload(me).

    If the form is modal then the code will pass back to the User_Macro module and you could put the Unload(frmNewMembers) there instead but only after you have hidden the form.

    If you need any more help then do not hesitate to ask.

    David

    David Zeidman
    Zeidman Development
    http://www.zeidman.info

    Check out my RE API blog
    http://www.re-decoded.com
  • 06-12-2008 7:38 PM In reply to

    • Jim Hannum
    • Not Ranked
    • User Since: 2005
    • Posts 5
    • Organization: Grand Chapter of California Order of the Eastern Star
    • Products:  The Raiser's Edge

    Re: Forms

    Yes, either method works. However I get a runtime error if I used Unload(object). When I write the line as

    Unload Me

    or

    Unload frmNewMembers

    then everything works fine.

    Thank you for the advise. I am sure the I will be back for more. I have had a very little programming experience. Building reports in Crystal Reports was not too bad. But there is a lack of documentation for VBA programming, and I need good documentation.

    Thanks again. 


     

  • 06-13-2008 4:44 AM In reply to

    • David Zeidman
    • Top 25 Contributor
    • User Since: 2002
    • Posts 326
    • Organization: Zeidman Development
    • Products:  Blackbaud Direct Marketing, Blackbaud Enterprise CRM, The Information Edge, The Raiser's Edge

    Re: Forms

    Yes you are correct. It is without the parenthesis in VBA/VB6. I wrote my answer a bit too late at night and got confused. Pleased it is working now.

     David

    David Zeidman
    Zeidman Development
    http://www.zeidman.info

    Check out my RE API blog
    http://www.re-decoded.com
Page 1 of 1 (4 items)