I need to obtain the value (a long integer) from each control on my form
but one line of code is giving me an error message.
The error message says "Run-time error 2455, You entered an expression that has an invalid reference to the property value"
The line that is giving me the error is:
quantityshipped = ctl.Properties("Value")
----------------------------------------------
Here is part of the code
Dim ctl As Control
Dim frm As Form
Set frm = Forms![frmResults2]
For Each ctl In frm.Controls
If TypeOf ctl Is TextBox Then
If ctl.Value <> "" Then
productname = ctl.Properties("Name")
quantityshipped = ctl.Properties("Value") 'This line does not work and returns an error message
etc.
---------------------------------------------------
The "Name" property above works, but the value property will not work
I even tried coding it
quantityshipped = ctl.value
All of my code works EXCEPT that one line (above)
any help would be appreciated. I need to obtain the long integer value from this control and store it into a variable.
but one line of code is giving me an error message.
The error message says "Run-time error 2455, You entered an expression that has an invalid reference to the property value"
The line that is giving me the error is:
quantityshipped = ctl.Properties("Value")
----------------------------------------------
Here is part of the code
Dim ctl As Control
Dim frm As Form
Set frm = Forms![frmResults2]
For Each ctl In frm.Controls
If TypeOf ctl Is TextBox Then
If ctl.Value <> "" Then
productname = ctl.Properties("Name")
quantityshipped = ctl.Properties("Value") 'This line does not work and returns an error message
etc.
---------------------------------------------------
The "Name" property above works, but the value property will not work
I even tried coding it
quantityshipped = ctl.value
All of my code works EXCEPT that one line (above)
any help would be appreciated. I need to obtain the long integer value from this control and store it into a variable.