Can I script a new value to a checkmark group that already contains a value?
I would like to do the following;
If the field "FormID" is "19" Then
copy the value from the field "_15" to the field "ExportField"
And After That make the field "_15" equal to "" (blank)
When I run the following script I get this error,
"This operation is not allowed. (line 4, pos 9)"
If me.Field("FormID").Text = "19" Then
If Len(me.Field("_15").Value) > 0 Then
me.Field("ExportField").Text = me.Field("_15").Value
me.Field("_15").Text = ""
Else
me.Field("ExportField").Text = ""
End If
End If
The error appears to occur here
me.Field("_15").Text = ""
I think it is because the field "_15" is a checkmark group. The script fails IF there is a value in the checkmark group and therefore the script attempts to write "" (blank) upon completion when there was a different value in the field.
I think am able to get around this by ungrouping the ckmk group and making a simple Yes and No checkmark. From there I can move the value to a text field, and from the text field I should have no problem changing the value. But I am hoping there is a more graceful way to accomplish this.
Thanks in Advance,
Any help appreciated.
Dan Ayo
I would like to do the following;
If the field "FormID" is "19" Then
copy the value from the field "_15" to the field "ExportField"
And After That make the field "_15" equal to "" (blank)
When I run the following script I get this error,
"This operation is not allowed. (line 4, pos 9)"
If me.Field("FormID").Text = "19" Then
If Len(me.Field("_15").Value) > 0 Then
me.Field("ExportField").Text = me.Field("_15").Value
me.Field("_15").Text = ""
Else
me.Field("ExportField").Text = ""
End If
End If
The error appears to occur here
me.Field("_15").Text = ""
I think it is because the field "_15" is a checkmark group. The script fails IF there is a value in the checkmark group and therefore the script attempts to write "" (blank) upon completion when there was a different value in the field.
I think am able to get around this by ungrouping the ckmk group and making a simple Yes and No checkmark. From there I can move the value to a text field, and from the text field I should have no problem changing the value. But I am hoping there is a more graceful way to accomplish this.
Thanks in Advance,
Any help appreciated.
Dan Ayo
Comments
2 comments
Checkmarks and checkmark groups aren't text fields, which is why you're having some trouble.
You need to get to the checkmarks within the checkmark group "_15"; are they included in your rule?
You can then manipulate the checkmark values like this picture shows.
I got this to work for me.
If me.Field("FormID").Text = "19" Then
If Len(me.Field("ckmkgroupTEST").Text) > 0 Then
me.Field("_117").Text = me.Field("ckmkgroupTEST").Text
me.Field("Y").Value = False
me.Field("N").Value = False
End If
End If
Please sign in to leave a comment.