Results 1 to 2 of 2

Thread: [RESOLVED] error 2100 on Access form

  1. #1

    Thread Starter
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,602

    Resolved [RESOLVED] error 2100 on Access form

    Hi all.
    I think this post belongs here because it is more of a VBA code question than a database question.

    Just for fun, I wrote a Tetris game in Access using a form and a module.
    I have 200 labels on my screen that I put in an array to be placeholders for locking a piece in place when it hits bottom.
    I think this is well below the allowable number of components on a form.
    The grid on this game is 10 squares wide by 20 tall, with each square being 576 each way.


    The game is mostly finished and is playable, but an error has started popping up.
    It is error 2100: the component or subform component is too large for the area.
    This error happens always when a piece is being rotated and always when the .TOP value is being assigned.
    Other than that, it is random and unpredictable when it pops up, but it does come up often.
    Every .TOP value that throws the error has been assigned numerous time without error, so I don't know what causes the code to perceive a problem with the value.
    I checked the values when it stops on error, and there's nothing funny about them. The errors so far have not happened when I just move the pieces left or right and let them fall or drop them.
    It's only when they are rotated, and then again just at random times.

    For the rotation subroutine, I break it down by the different pieces and their various orientations.
    I pick a single square (one of four squares that each piece has) and I make that the center point around which the piece rotates, so one piece stays in place and the other three change position accordingly.
    The error isn't thrown by a particular piece or by a particular orientation or at a particular height. It seems to happen to any piece at any orientation at any height on the screen, but not consistently.
    It might happen after 10 pieces fall or after 100.

    Any thoughts?
    Thanks.
    Wen Gang, Programmer
    VB6, QB, HTML, ASP, VBScript, Visual C++, Java

  2. #2

    Thread Starter
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,602

    Re: error 2100 on Access form

    Well, I wrestled with this a couple of days before posting, but today I "solved" it. It appears to be that the line the code stops on is not where the error is happening. The error happens when a piece is committed to the grid immediately after rotation, and then the rotation keystroke is being sent to the next piece, which starts at the top of the grid. When the piece attempts rotation, it's causing negative .TOP numbers. I solved it short term by moving everything on the form down about an inch. Long term, I will solve it permanently when I write the piece rotation constraints that won't allow rotating above the top of the grid. So you could say I swerved into the answer just by hunch. Thanks all.

    So why put Tetris inside Access? Well, if you work in an environment where you can't install things on your computer, you can drop this form and module into any Access database on the PC, then start the form, play a quick game, and then close the form.
    Wen Gang, Programmer
    VB6, QB, HTML, ASP, VBScript, Visual C++, Java

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width