[AccessD] overflow

Pedro Janssen pedro at plex.nl
Sun Dec 24 07:11:48 CST 2006


Hello Stuart,

i changed the code (see below), but now it isn't working.
After clicking the button, nothing happens. The second time clicking the 
button, the first word of the text is selected, the third time clicking, i 
get an error: Run-time error 5, invalid procedure call or argument.

Pedro


------code----------------
Private Sub cmdSearch_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 > 32767 Then
      plaats = plaats - 65536
      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----------------------




----- Original Message ----- 
From: "Stuart McLachlan" <stuart at lexacorp.com.pg>
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Sent: Sunday, December 24, 2006 12:58 AM
Subject: Re: [AccessD] overflow


> Just a WAG, but sInce the maximum size of a textbox is 64K,
> a negative SelStart may work, so try:
>
> If plaats > 32767 then plaats = plaats - 65536
>
>
> On 24 Dec 2006 at 0:16, Gustav Brock wrote:
>
>> Hi Pedro
>>
>> You could read in the memo field in chunks of 32K until a match or the 
>> last
>> chunk is read. That should be fine, if all you need is to display a 
>> match.
>> If you wish to edit the text, the plot thickens ... /gustav
>>
>>
>> >>> pedro at plex.nl 24-12-06 0:00 >>>
>> Hello Gustav,
>>
>> i didn't know that.
>> Can i use something else for this, or work around.
>> Otherwise i have to use an other search function.
>>
>> Pedro
>>
>>
>>
>> ----- Original Message ----- 
>> From: "Gustav Brock" <gustav at cactus.dk>
>> To: <accessd at databaseadvisors.com>
>> Sent: Saturday, December 23, 2006 11:47 PM
>> Subject: Re: [AccessD] overflow
>>
>>
>> > 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--------------------------
>> > -- 
>> -- 
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>
> -- 
> Stuart
>
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list