Gustav Brock
gustav at cactus.dk
Sat Dec 23 16:47:14 CST 2006
Hi Pedro
The value of SelStart itself is limited to the max. positive value of an Integer.
/gustav
>>> pedro at plex.nl 23-12-06 22:49 >>>
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--------------------------
--