Multiple step operation generated errors.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Multiple step operation generated errors.

  1. #1
    Join Date
    Sep 2005
    Posts
    106

    Multiple step operation generated errors.

    Hello
    I'm trying to setup a textbox to allow multiple lines. I tried setting it to multiple lines in the properties and I tried with verticle scroll bars and without. But when I write mutiple lines in the textbox then try to save it it gives the error "Multiple step operation generated errors. Check each status value" on this line...
    Code:
    Private Sub cmdUpdate_Click()
      Dim I as Integer
      With recset
           If Not .EOF Then
              .Fields("Comment") = Me.txtComment.Text   'error here 
              .Update       
           End If
       End With
    End Sub
    Kind of bizarre didn't think it would be difficult to do this. Any ideas??
    Steve

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    What kind of database are you using? What are the type and size of the Comment column? How long is txtComment.Text when the error occurs?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Mar 2005
    Location
    Los Angeles, Calif. AKA: Gangsta Yoda™
    Posts
    455
    The code doesnt look right. You dont need the var "I" as you are not using it and it looks like you are trying to update a field so has the recordset been moved before your attempted to edit the current record? That will be the issue sometimes because the rs is marked as edited but if you recset.movenext or something without calling the .update method and then try to edit again, then it throws the error.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer code questions via PMs.
    Microsoft MVP 2006-2009
    Office Development FAQ (VBA, VB6, VB.NET, C#)
    Software Engineer MCP (VB6 & .NET)
    Reps & Rating PostsVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6Outlook Global Address List

  4. #4
    Join Date
    Sep 2005
    Posts
    106
    Hello
    Thanks for the reply. I can see where the confusion would come in.
    I'm using an Access database. I set the field limit to 250 in Access and set the property for the textbox to limit of 250 so it doesn't error anymore.

    The Dim I as Integer is used here...
    Code:
    For I = 0 to 2
       If Me.opt(I) = True Then .Fields("pkStatus") = I
    Next I
    .Update
    sorry for the confusion.
    Unless I'm missing something I think it's ok now

    Steve

  5. #5
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    I still do not understand.
    what you are doing is to assign to all the Fields of your RecordSet (with opt(i)=true) to the same string, that is the content of the TextBox. Is that right? Or, but I am guessing here, each line of the textBox corresponds to a differente Field of your RecordSet (and in that case you can split the string in the TextBox using the Split function)?

    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  6. #6
    Join Date
    Sep 2005
    Posts
    106
    maybe this makes more sense
    Code:
    Private Sub cmdUpdate_Click()
       Dim I As Integer
       With recSet
           If Not .EOF Then
              .Fields("FSE") = Me.txtFSE.Text
              .Fields("Customer") = Me.txtCustomer.Text
              .Fields("Comment") = Me.txtComment.Text
              .Fields("Date") = CDate(Me.txtDate.Text)      
              'Set option to null in case no options were selected
              .Fields("pkStatus") = Null   'was status
              For I = 0 To 2
                'If Opt Control of Index I is true then set Option to I
                'which is the Index value of the option that was selected            
              If Me.opt(I) = True Then .Fields("pkStatus") = I   'was status
              Next I
              'make sure to update the record with the changes
              .Update
           End If
       
       mbEditFlag = False
       mbAddNewFlag = False
       SetButtons True
       mbDataChanged = False
       lblRecord.Caption = "Record: " & CStr(recSet.AbsolutePosition) _
          & " of " & (recSet.RecordCount)
       lblStatus = "Record added"
        End With
    End Sub

Similar Threads

  1. Replies: 1
    Last Post: 05-29-2002, 05:16 PM
  2. Multiple step operation generated errors
    By John Wood in forum VB Classic
    Replies: 5
    Last Post: 12-06-2001, 08:53 PM
  3. Multiple-step operation generated errors
    By Rahul in forum VB Classic
    Replies: 1
    Last Post: 10-15-2001, 04:33 AM
  4. Multiple-step operation generated ERRORS check...
    By DAVID king in forum VB Classic
    Replies: 1
    Last Post: 06-07-2001, 04:44 PM
  5. Replies: 3
    Last Post: 05-20-2001, 12:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center