this is driving me crazy...
I have a very simple piece of code in a form under the onload event:
Code: Select all
If intOrigenAccion = 1 Then
Me.COD_CLIENTE.Value = strCodCliente
Me.txtNombreOportunidad.Enabled = False
ElseIf intOrigenAccion = 2 Then
MsgBox "id oportunidad = " & intIdOportunidad
Me.txtIdOportunidad = intIdOportunidad
Me.txtNombreCliente.Enabled = False
End If
But if If intOrigenAccion = 2, then I get the error 2448 - You can't assign a value to this object (sometimes I get the error -2147352567, which is basically the same thing, I guess) when doing this Me.txtIdOportunidad = intIdOportunidad.
I have checked through a MsgBox that the value of the variable is what is expected (an integer)
The sourcefield type of "txtIdOportunidad" is also integer
The allow edit property of the form is set to yes
I have even deleted all the DB relationships but I'm still getting the error.
What else can I check to see what's wrong?
Thanks