I have code that has been working fine in access 2002, but in access 2003 it just freaks out by staying in an endless loop.
the code is in the On Change event for a textbox.
Here's the code:
Private Sub txtCityName_Change()
Dim db as dao.database
Dim rs as dao.recorset
dim strsql as string
Dim vCity as string
Dim vNameLen As Integer
If gClear = True then
Me.txtCityName.Text = ""
Exit Sub
End if
What happens is after I hit enter in the text box, it hits the change event and goes down into the subroutine, because gClear(a global variable) has been set to true. After it hits the Exit Sub It goes right back up to the top(Private Sub txtCityName_Change()) and starts over. It just keeps doing this endlessly. Like I said earlier. This works fine in Access 2002 but not in 2003.
Any help would be appreciated.
the code is in the On Change event for a textbox.
Here's the code:
Private Sub txtCityName_Change()
Dim db as dao.database
Dim rs as dao.recorset
dim strsql as string
Dim vCity as string
Dim vNameLen As Integer
If gClear = True then
Me.txtCityName.Text = ""
Exit Sub
End if
What happens is after I hit enter in the text box, it hits the change event and goes down into the subroutine, because gClear(a global variable) has been set to true. After it hits the Exit Sub It goes right back up to the top(Private Sub txtCityName_Change()) and starts over. It just keeps doing this endlessly. Like I said earlier. This works fine in Access 2002 but not in 2003.
Any help would be appreciated.