I have a NumericInput in a display and I want to use in VBA.
ex: dim data as integer data = Me.NumericInput1.value data = data * 123 - 2
This VBA is work but I want to use the NumericInput1 of a other display.
Can you help me ?
panic mode
Oct 29 2007, 12:04 PM
no idea about RSView but since it's VB or VBA:
you can't have two controls with same name on a same form.
either that other "Me.NumericInput1" is really "Me.NumericInput2" or stop using "Me." and specify form name such as "Display4.NumericInput1".
"Me." is used to identify current form only (and save a bit on typing) but to access controls from another form, you have no choice but to specify actual form name as mentioned.
arkansascontrols
Oct 31 2007, 10:10 PM
There may be other ways to accomplish this, but one way to get the job done is to create a reference tag in RSView and assign it as the tag for the NumericInput on the other screen, if the NumericInput is writing a value to your PLC then be sure to assign the Datasource for your reference tag to the actual DataSource in the PLC. Then in your VBA code you can simply write it like this;
dim Data as Integer Data = My_New_HMI_INT_Tag Data = Data * 123 - 2
I have a NumericInput in a display and I want to use in VBA.
ex: dim data as integer data = Me.NumericInput1.value data = data * 123 - 2
This VBA is work but I want to use the NumericInput1 of a other display.
Can you help me ? [/quote]
panic mode
Nov 5 2007, 10:04 PM
QUOTE(arkansascontrols @ Oct 31 2007, 10:10 PM) [snapback]61086[/snapback]
I have a NumericInput in a display and I want to use in VBA.
data = Me.NumericInput1.value
This VBA is work but I want to use the NumericInput1 of a other display.
i've just suggested that you have to replace "Me." with actual form name (display) where NumericInput1 is actually located. did you try this?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.