Re: VB6 OverFlow problem

  • From: "Jeff Bishop" <jeff@xxxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 8 Oct 2009 08:52:12 -0700

Glad it fixed it <smile>.

Jeff

  ----- Original Message ----- 
  From: Geoff Smith 
  To: programmingblind@xxxxxxxxxxxxx 
  Sent: Thursday, October 08, 2009 8:50 AM
  Subject: Re: VB6 OverFlow problem


  Hello Jefff,

  That was very helpful and painless <G>. Wish I'd thought of that, before 
shouting.

  Thanks.

  Geoff
  Email: gc.smith@xxxxxxxxxx
    ----- Original Message ----- 
    From: Jeff Bishop 
    To: programmingblind@xxxxxxxxxxxxx 
    Sent: Thursday, October 08, 2009 3:59 PM
    Subject: Re: VB6 OverFlow problem


    Change the data types from Integer to Long and see if that resolves your 
issue.

    Jeff

      ----- Original Message ----- 
      From: Geoff Smith 
      To: programmingblind@xxxxxxxxxxxxx 
      Sent: Thursday, October 08, 2009 7:55 AM
      Subject: VB6 OverFlow problem


      Hello All,

      I realise there aren't many people using VB6 these days, but can anyone 
help me with this irretating problem?

      In short blocks of text in an MSAccess memo type field I can use the code 
below to search text, but anything longer than 3/4 thousand characters, I'm 
getting an overflow message with an error 6. When I click on the OK button, the 
programme bombs.

      The Code is:

      Private Sub mnuNavSearchText_Click()
      Dim strMainString As String
      Dim intLengthOfString As Integer
      Dim intWheresTheString As Integer

      ' Assigning the variables
      strMainString = txtTB(4) ' String1, String  to be searched
      intLengthOfString = Len(strMainString) ' Length of string to be searched

      M_strSearchFor = InputBox$("Search for Text, ", , "")

      intWheresTheString = InStr(strMainString, M_strSearchFor) ' Arguements 
employed

      If intWheresTheString Then ' If string found
      txtTB(4).SelStart = intWheresTheString - 1  'Start the selection and
      txtTB(4).SelLength = Len(M_strSearchFor)  ' set selection length
      MsgBox "String Found" ' Notify user of successful result
      Else ' or
      MsgBox "String not found" ' notify user of the resulting failure
      txtTB(4).SetFocus
      End If
      End Sub

      The Outlook Express window seems to have made a bit of a mess of the 
code, spilling some lines onto two lines.

      Can anyone see what is happening? I'd be very grateful for any help.

      Geoff
      Email: gc.smith@xxxxxxxxxx


----------------------------------------------------------------------------



    No virus found in this incoming message.
    Checked by AVG - www.avg.com 
    Version: 8.5.421 / Virus Database: 270.14.7/2422 - Release Date: 10/08/09 
06:39:00

Other related posts: