Really basic VBA question...

xC0MMAND0x

Member
Join Date
Jul 2013
Location
Minnesota
Posts
265
FTViewSE 7.0.

I'm trying to set Object.Value = Object2.Value under certain conditions, but it doesn't seem to work.

I have 2 objects on the screen exposed to VBA Control. The If statement is all fine, as I can run ExecuteCommand and MSGBox("test") etc etc.

Why can't I set .value to another .value?

Alternatively this would work too:

NumericDisplay2.Value = 1.

But I can't seem to alter .Value of objects on the screen?

Private Sub NumericDisplay1_Change()

On Error GoTo ErrorHandler

If Not IsError(NumericDisplay1_Step.Value) Then

If (NumericDisplay1.Value > 100) Then
NumericDisplay2.Value = NumericDisplay1.Value
End If

End If

ErrorHandler:
Exit Sub

End Sub
 
Here are my suggestions:
1. That equal sign (=) between NumericDisplay2.Value & NumericDisplay1.Value may not be an assignment operator, search within the scripting engine how to set one variable to another.

2. try creating a new integer variable and set NumericDisplay1.Value to the new variable that you just created then finally set the new variable to NumericDisplay2.Value


 

Similar Topics

Hi all. I normally have the luxury or having to fault find stuff and only have to modify others code. However I now find myself in the position...
Replies
4
Views
1,871
Local Rockwell distributor was in today. He says that the MicroLogix 1400 will likely be unavailable to purchase sometime around the end of this...
Replies
58
Views
16,768
Good Morning , I've taken on a job that is truly over my head with a engineering group. The standards of Rockwell programming is much more...
Replies
15
Views
7,105
I’ve been looking at buying a quantity of signal converters to take a type J or k thermocouple or RTD and convert it to a 4-20mA signal. In...
Replies
10
Views
3,025
Doing some consulting work using factorytalk view studio and RSLogix5000. We set up alarms for the system a while ago and they work fine, as do...
Replies
5
Views
3,669
Back
Top Bottom