Re: Program flow problems
where is this code called?
Re: Program flow problems
Code:
Private Sub Textbib_KeyPress(Index As Integer, KeyAscii As Integer)
Dim i As Integer
If KeyAscii = 9 And Not ShiftPressed Then
If Textname(Index).Text = "" Then ' ensure name is entered
Textname(Index).SetFocus
Exit Sub
End If
If Textclub(Index).Text = "" Then ' ensure club is entered
Textclub(Index).SetFocus
Exit Sub
End If
If Len(Textbib(Index).Text) = 1 Then Textbib(Index) = "0" & Textbib(Index) ' ensure two digit bib number or enter a leading "0"
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
Below this point it checks to find out how many textbox rows are on the screen to decide if it needs to show another or if it needs to scroll the data up.
Other than this one particular situation the code works exactly like I want it to.
Re: Program flow problems
A suggestion:
For checking empty textboxes, check it's length....:
Code:
If len(Textname(Index).Text) = 0 Then
Because, if there is a space, then your checking condition won't be going to work... :wave:
1 Attachment(s)
Re: Program flow problems
Good point. I hadn't even though about that. At times I'm thinking multi users and at other times I'm thinking about me being the only person using the program.
I've found the same problem, mentioned in my previous posting, in another part of the program now. When creating the database which will be used to print off the registration bubble sheets, later, I have it check to make sure the same name isn't entered twice. It seems like the problem is the same as what I mentioned before. I'm totally stumped on the entire problem.
I've included all the necessary code that is running the program up to this point in the .zip file. Both text files should go in a folder C:\Jump Results. I have the program setup to automatically allow the user to create a new file just by hitting the ESC key or to choose which file they want to save to. Everything gets saved to a specific location that way there is no losing anything. The program also automatically saves the data so there is very little chance of losing any data(the computer this program has been used on in the past is known to turn itself off while you are typing). I decided not to take any chances as I started writing this a couple winters ago. Better safe than sorry.