Modify Variable Statement
The Modify Variable statement runs a series of statements on a variable. It does not return a value. The value you specify in the variable argument can be an object or a custom type. You can nest With statements.
Format
With variable
   statement_block
End With
The following table describes the arguments that you can use with this method.
| Argument | Description | 
|---|---|
variable  | 
The variable that Siebel VB modifies in the statement_block.  | 
statement_block  | 
The statements that Siebel VB runs on the variable.  | 
Example
The following example uses a Siebel VB method to modify the values that an object contains if Siebel CRM modifies a field value. The Modify Variable statement references this object:
Sub BusComp_SetFieldValue(FieldName As String)
   Select Case FieldName
      Case "Account Status"
      If Me.GetFieldValue(FieldName) = "Inactive" Then
         Dim oBCact as BusComp
         Dim sMessage as String
         Set oBCact = me.BusObject.GetBusComp("Action")
         sMessage = “ADDED THRU SVB: Account Status made Inactive"
         With oBCact
            .NewRecord NewAfter
            .SetFieldValue "Type", "Event"
            .SetFieldValue "Description", sMessage
            .SetFieldValue "Done", _
            Format(Now(),"mm/dd/yyyy hh:mm:ss")
            .SetFieldValue "Status", "Done"
            .WriteRecord
         End With
         set oBCact = Nothing
      End If
      End Select
End Sub
For another example, see Remove Object Method.