NewRecord - strange

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

    #1

    NewRecord - strange

    If i type NewRecord in some code, VB change to newrecord with lower-case
    letter. If I open a new database on the same computer the NewRecord keyword
    act normally. Ha anybody experienced something like this??
    TIA

    Sigurd


  • Allen Browne

    #2
    Re: NewRecord - strange

    Access is remembering something that was called "newrecord" .

    To help if forget, do this inside some procedure:
    Dim NewRecord As Integer

    Compile.
    Save.
    Delete the stupid line again.
    Compile.
    Save.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html

    "Sigurd Bruteig" <nbrute@online. no> wrote in message
    news:bAM5b.2003 2$os2.276855@ne ws2.e.nsc.no...[color=blue]
    > If i type NewRecord in some code, VB change to newrecord with lower-case
    > letter. If I open a new database on the same computer the NewRecord[/color]
    keyword[color=blue]
    > act normally. Ha anybody experienced something like this??
    > TIA[/color]


    Comment

    • Sigurd Bruteig

      #3
      Re: NewRecord - strange


      "Allen Browne" <abrowne1_SpamT rap@bigpond.net .au> wrote in message
      news:p9R5b.8361 4$bo1.3019@news-server.bigpond. net.au...[color=blue]
      > Access is remembering something that was called "newrecord" .
      >
      > To help if forget, do this inside some procedure:
      > Dim NewRecord As Integer
      >
      > Compile.
      > Save.
      > Delete the stupid line again.
      > Compile.
      > Save.
      >
      > --[/color]
      Thank you. Now is is back to NewRecord, but it seems like there is a problem
      in some forms where I have used NewRecord. When i go to a new record, the
      new record, and next record in the navigation bar is not disabled, and it is
      possible to open an endless number of new records. Do you have any ideas??

      Sigurd


      Comment

      • Sigurd Bruteig

        #4
        Re: NewRecord - strange


        "Allen Browne" <abrowne1_SpamT rap@bigpond.net .au> wrote in message
        news:j8X5b.8385 8$bo1.1386@news-server.bigpond. net.au...[color=blue]
        > That sounds like normal behaviour. If you do not want a user to be able to
        > add new records, set the form's AllowAdditions property to No. Unless the
        > record is already dirty, this will prevent new entries.
        >
        > --
        > Allen Browne - Microsoft MVP. Perth, Western Australia.
        > Tips for Access users - http://allenbrowne.com/tips.html
        >[/color]

        Now it is back to normal. It seems like I had to comment out all NewRecord
        code, run your metode in every classmodule affected, and then decomment the
        code again. Thank you again.

        Sigurd


        Comment

        • Nick Marshall

          #5
          Re: NewRecord - strange


          "Sigurd Bruteig" <nbrute@online. no> wrote in message
          news:bAM5b.2003 2$os2.276855@ne ws2.e.nsc.no...[color=blue]
          > If i type NewRecord in some code, VB change to newrecord with lower-case
          > letter. If I open a new database on the same computer the NewRecord[/color]
          keyword[color=blue]
          > act normally. Ha anybody experienced something like this??
          > TIA
          >
          > Sigurd
          >
          >[/color]
          Possibly Microsoft do NOT save the actual text 'NewRecord' but change it
          instead to a token. This is done in things, such as compilers, to make it
          easier (for the program) to understand what is what.

          For example: in BASIC you might type the following code: Let A=2:Let
          B=3:Let C=A+B:Print A,B,C

          The compiler [or interpreter!] could 'translate' it into something like:

          @ [memory location] = 2: @ [memory location+1] = 3: @ [memory location+2] =
          [memory location] + [memory location+1]: [call print routine ([memory
          location], [memory location+1], [memory location+2])]

          Where:
          @ is the token for LET (or Store)
          [memory location] is an area of RAM
          [call print routine (data)] is the address of a routine to send (data) to
          the printer

          I realise that this is a very simplistic model - pseudo machine code would
          have been better, if you knew what the code was meant to do! - but should go
          to show the benefits of changing a keyword to a token.

          This is what the translator does -> compiling the code. When you decompile
          the code -> English, you could get a different keyword back!

          e.g. in my example, LET = @ on compilation but @ = Let on decompilation, if
          you see what I mean. Which is why NewRecord could become token #, whereas
          token # prints as newrecord. You can see this process 'happening' when you
          enter code into the VBA Editor. As soon as you complete a line VBA parses
          it, 'tokenises' it, then displays it in a standard format, i.e. with extra
          spaces, different colours, etc.

          HTH

          Nick


          Comment

          Working...