Pedro Janssen
pedro at plex.nl
Sat Dec 23 15:49:51 CST 2006
Hello Group, when using the search function below and when the position of the word that is used in the search-string in field "Plaats" is above 32,767 (memofield), i get an runtime error 6, overflow . I changed in the code: "Dim plaats As Integer" to "Dim plaats As Long", but still have the same error. I don't understand why? Pedro Janssen ------------------code------------------------------- Option Compare Database Dim plaats As Integer Private Sub Knop21_Click() If dummy <> "" Then tekstplaats = plaats If tekstplaats = 0 Then tekstplaats = 1 End If INHOUD.SetFocus plaats = INHOUD.SelStart + Len(dummy) + 1 plaats = InStr(tekstplaats + 1, INHOUD, dummy, 1) If plaats <> 0 Then INHOUD.SelStart = plaats - 1 INHOUD.SelLength = Len(dummy) Else INHOUD.SelStart = 0 INHOUD.SelLength = 0 End If tekstplaats = plaats Else MsgBox "Kan geen lege tekst zoeken !!", 16, "Tekst zoeken" End If End Sub ------------------/code--------------------------