Results 1 to 4 of 4

Thread: Forms behaving badly!

  1. #1

    Thread Starter
    Addicted Member S@NSIS's Avatar
    Join Date
    Aug 2000
    Location
    Stoke-On-Trent, England
    Posts
    243

    Angry

    Hi,
    Best way to explain this!

    I have 3 Forms, frmMain,frmStatus and frmCheckedOut.
    After pressing a button on frmMain, frmStatus is shown (vbModal) and a series of code(in a module) is executed. If this code finds that files are checked out then frmCheckedOut is shown (on top of frmStatus, vbModal). This form asks if you want to proceed. Now this is where the problem lies....
    If I click yes then instead of carrying on in the next line of code in the module after the form was called, it starts the whole sub again thus resulting in an endless loop of frmCheckedOut popping up. HOWEVER, if I put a breakpoint in at the part where frmCheckedOut is called and step through the code, then once frmCheckedOut has unloaded, the code continues with the NEXT line of code in the module.(which is what I want, only without having a breakpoint in!!!).
    I thought maybe I needed a DoEvents somewhere but have tried this with no success .

    Has anybody got any suggestions??

    Any help will be appreciated

    Shaun
    Web/Application Developer
    VB6 Ent (SP5), Win 2000,SQL Server 2000

  2. #2
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    I assume you are calling it like this.

    frmwhatever.show 1


    Its tough to tell whats happening without seeing the code.
    are you sure the sub is starting over or is the sub being call from somewhere else again and again. Like from form_activate or some got_focus?

    [Edited by kurtsimons on 09-01-2000 at 10:38 AM]
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  3. #3

    Thread Starter
    Addicted Member S@NSIS's Avatar
    Join Date
    Aug 2000
    Location
    Stoke-On-Trent, England
    Posts
    243
    Hi,
    Sorry, but I can't post the code (two reasons..1) it's massive and 2) it's confidential (Work!!)). I can tell you though that 9 other developers have all looked at it and cannot understand what is going on either .
    The call to the form is:
    Code:
    frmCheckedOut.Show vbModal
    This appears nowhere else but in the GetSourceSafeFiles Sub,
    and this sub is only called once from.......

    Got it....

    The call to the sub is in the Form_Activate of frmStatus.

    Thats why it is doing it...

    Thanks Kurt, I had done a workaround for it using a variable to say whether or not it had been called before but it has just dawned upon me what's happening whilst I was writing this reply to you!

    Cheers, Sorted now

    Shaun
    Web/Application Developer
    VB6 Ent (SP5), Win 2000,SQL Server 2000

  4. #4
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    Glad to help... thought I was shooting into the dark!
    Kurt Simons
    [I know I'm a hack but my clients don't!]

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