So I created a simple form with 4 radio optionbuttons. When I open the form and select an option it writes a value to DVSYS.MOD/xxx.F_CV. Once I close and reopen the vba script, I don't see the choice anymore, however, I can pick the same option to make the "darken" circle come up again. It would mean that I am rewriting the same value back to the DeltaV side because the value has been written to a parameter already. I tried to do a simple IF/THEN statement to read value from deltaV but it gives me an error. Any suggestions on making the radio optionbuttons to be selected on the current value from the deltaV side?
Example below:
OptionButton4_Click()Dim Result As VbMsgBoxResult Result = MsgBox("Switchover?", vbOKCancel, "Selector Confirmation") If Result = vbOK Then writevalue "3", "DVSYS.MOD/xxx.F_CV" End IfEnd Sub
Private Sub UserForm_Initialize()
If "DVSYS.MOD/XXX.F_CV" = 0 ThenOptionButton1 = TrueEnd If
If "DVSYS.MOD/XXX.F_CV" = 1 ThenOptionButton2 = TrueEnd If
If "DVSYS.MOD/XXX.F_CV" = 2 ThenOptionButton3 = TrueEnd If
If "DVSYS.MOD/XXX.F_CV" = 3 ThenOptionButton4 = TrueEnd If
End Sub
In reply to Matt Stoner:
In reply to JackC: