Re: VB6 OverFlow problem

  • From: "Geoff Smith" <gc.smith@xxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 9 Oct 2009 18:10:32 +0100

I know it's a while since I did any programming, but I'm really rusty.

It's surprising that such little, simple things like that, can trip you up.

Yep. It works beautifully.

I'll probably relearn everything, when I get round to learning VB.NET 2008. 
It'll be interesting to see how quickly I pick it up.

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


  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



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



  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: