Results 1 to 5 of 5

Thread: Program flow problems

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2010
    Posts
    18

    Program flow problems

    I have stumbled into an interesting problem. Actually I stumbled into it last year and it has come back up once again. I didn't get the problem taken care of last year so it has been left over to deal with this year.

    In my program when the person doing data entry, types in the bib number and hits the tab key the program is suppose to search the data file and make sure that no one else has the same bib. If the person doing the data entry mistyped or whatever and put the same bib number in twice the program is suppose to bring up a msgbox saying "Bib number already in use". Then its suppose to reset the focus back on the bib textbox so the correct bib can be reentered.

    To this point everything runs smooth. It checks for the multiple bib, brings up the msgbox, if necessary, and then takes the user back to the bib textbox to retype in the bib number.

    The problem comes when the user tabs off the bib the second time. The program doesn't perform like it's suppose to. Instead of sorting the bibs, if need be, and putting a blank row of textboxes below the ones most recently used, it sorts the bibs removes the top entry altogether and leaves two blank rows of textboxes at the bottom.

    Now the odd twist'S'. If I use Debug to step through it, everything works fine. If I put in a secondary msgbox in the area around where it's searching for the multiple bibs, everything works fine. It acts like if I put a pause in the system everything works fine. If after putting in the initial wrong bib number I instead cursor up to one of the other bibs and tab off it and then come back down and enter the correct bib number and tab off it again than it works fine. It won't work fine I do it straight through without any kind of a 'pause'/interruption. Everything else works exactly the way it should. This one almost does. Below is the code in the area where I'm having it do the searching for the multiple bibs. Granted I don't think it will help any but you never know.

    Code:
            If lastentry > 0 Then 'check that bib number isn't already in use
                If Textbib(index).Text <> "" Then
                    For i = 0 To lastentry
                        If Textbib(index) = bib(i) Then
                            MsgBox "Bib number already in use"
                            Textbib(index) = ""
                            Textbib(index).SetFocus
                            Exit Sub
                        End If
                    Next i
                End If
            End If
    Last edited by meant2b; Feb 8th, 2010 at 10:44 PM.

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