initializing variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Weaver

    initializing variables

    I'm new to Access 97.

    Where's the best place to initialize global variables that are
    established in the declarations area?
  • Albert D. Kallal

    #2
    Re: initializing variables

    Do rememmber that any un-trapped exection error will destroy ALL global vars
    (you can distriubte a mde to your users..and this will NOT reset all
    vriables).

    The best palce is that in your main startup form, in the on-load event, you
    can call a "mainsetup" routine that is simply code in standard module.

    So, you can go

    Call MyStartUP

    And, in a modue, you have

    Public Sub MyStartUP

    gblUserName = currentUser()
    gblcurTaxRate = 0.07

    etc.

    end sub


    "Weaver" <we.aver@verizo n.net> wrote in message
    news:667211a4.0 409041151.43ba5 5c@posting.goog le.com...[color=blue]
    > I'm new to Access 97.
    >
    > Where's the best place to initialize global variables that are
    > established in the declarations area?[/color]


    Comment

    • Weaver

      #3
      Re: initializing variables

      Thanks for this. I had no knowledge of the untrapped errors problem.




      "Albert D. Kallal" <PleaseNOOOsPAM Mkallal@msn.com > wrote in message news:<w5p_c.318 369$gE.280531@p d7tw3no>...[color=blue]
      > Do rememmber that any un-trapped exection error will destroy ALL global vars
      > (you can distriubte a mde to your users..and this will NOT reset all
      > vriables).
      >
      > The best palce is that in your main startup form, in the on-load event, you
      > can call a "mainsetup" routine that is simply code in standard module.
      >
      > So, you can go
      >
      > Call MyStartUP
      >
      > And, in a modue, you have
      >
      > Public Sub MyStartUP
      >
      > gblUserName = currentUser()
      > gblcurTaxRate = 0.07
      >
      > etc.
      >
      > end sub
      >
      >
      > "Weaver" <we.aver@verizo n.net> wrote in message
      > news:667211a4.0 409041151.43ba5 5c@posting.goog le.com...[color=green]
      > > I'm new to Access 97.
      > >
      > > Where's the best place to initialize global variables that are
      > > established in the declarations area?[/color][/color]

      Comment

      • XMVP

        #4
        Re: initializing variables


        "Weaver" <we.aver@verizo n.net> wrote in message
        news:667211a4.0 409042255.31b18 1ac@posting.goo gle.com...[color=blue]
        > Thanks for this. I had no knowledge of the untrapped errors problem.[/color]


        It is not a problem for good developers because good developers always trap
        errors.


        Comment

        • Larry  Linson

          #5
          Re: initializing variables

          "XMVP" <access_morons@ hotmail.com> wrote
          [color=blue]
          > It is not a problem for good developers
          > because good developers always trap
          > errors.[/color]

          You've been caught sniping again, Donnie.

          If you'd provide useful answers to some real questions in this newsgroup,
          your pronouncements might get some respect. Given your behavior here,
          though, how can you expect anyone to think other than "What would the
          Resident Troll know about 'good developers'?"


          Comment

          • David Schofield

            #6
            Re: initializing variables

            On 4 Sep 2004 23:55:35 -0700, we.aver@verizon .net (Weaver) wrote:
            [color=blue]
            >Thanks for this. I had no knowledge of the untrapped errors problem.
            >
            >
            >[/color]
            One way of avoiding global variables being cleared by errors is to use
            controls on a global form instead.
            David Schofield


            Comment

            • Phil Kitchner

              #7
              Re: initializing variables


              "Larry Linson" <bouncer@localh ost.not> wrote in message
              news:uRO_c.2754 $x12.221@trnddc 05...

              Larry the Lickass, picks through the posts
              Where a newsgroup had been.
              Lives in a dream.
              Waits at his PC, wearing the thong
              That he keeps on a hook by the door.
              Who is it for?

              All the Access homos,
              Where do they all come from?
              All the Access homos,
              Where do they all belong?


              Comment

              • Tony Toews

                #8
                Re: initializing variables

                "Phil Kitchner" <philK88@hotmai l.com> wrote:
                [color=blue]
                >Message-ID: <mp5%c.14076$cb 5.12908@hydra.n ntpserver.com>[/color]

                Please ignore the above posting and others which are somewhat bizarre.

                Note to persons new to this newsgroup. One person, with many identities, is being
                rather disruptive. If you see a bizarre posting it's probably the work of this
                disruptive person..

                Check the headers of the posting. If you see the following the posting likely can be
                ignored. Of course, there will likely be other headers to be added to this list.

                Comments: This message did not originate from the Sender address above.
                It was remailed automatically by anonymizing remailer software.
                or
                X-Abuse-Report: abuse@teranews. com
                or
                Organization: Posted via Supernews, http://www.supernews.com
                or
                Organization: 100ProofNews.co m - Unlimited Downloads - $8.95/Month
                or
                X-Complaints-To: abuse@vnet-inc.com
                or
                Message-ID: <something>.nnt pserver.com

                You can also change your NewsReader program settings to ignore off-topic posts. See
                http://www.hyphenologist.co.uk/killfile/ for more information.

                Tony
                --
                Tony Toews, Microsoft Access MVP
                Please respond only in the newsgroups so that others can
                read the entire thread of messages.
                Microsoft Access Links, Hints, Tips & Accounting Systems at

                Comment

                • Megan

                  #9
                  Re: initializing variables


                  "Tony Toews" <ttoews@teluspl anet.net> wrote in message
                  news:tvrpj0pk67 1ob0dh95igcs9kb mmnojf3n4@4ax.c om...


                  Tony the Twinkie, pasting together
                  The words of a post that no one will hear.
                  No one comes near.
                  Look at him working, pulling his pud
                  In the night when there's nobody there.
                  What does he care?

                  All the Access homos,
                  Where do they all come from?
                  All the Access homos,
                  Where do they all belong?


                  Comment

                  Working...