-
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
-
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!
-
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.
-
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
-
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
-
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
-
By ethar in forum VB Classic
Replies: 1
Last Post: 05-29-2002, 04:16 PM
-
By John Wood in forum VB Classic
Replies: 5
Last Post: 12-06-2001, 08:53 PM
-
By Rahul in forum VB Classic
Replies: 1
Last Post: 10-15-2001, 03:33 AM
-
By DAVID king in forum VB Classic
Replies: 1
Last Post: 06-07-2001, 03:44 PM
-
By Bill Stone in forum VB Classic
Replies: 3
Last Post: 05-20-2001, 11:25 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|