My VB6 app won't compile anymore.
It tells me my control doesn't exist in the middle of the sub, but doesn't have any problems with it in the beginning of the sub.
me.txtm3 is the troublesome control.
Here's the code:
Private Sub CalPayKgs()
On Error GoTo errorhandler
If IsNull(Me.txtm3) Or Me.txtm3 = "" Then
Me.txtm3 = 0
If IsNull(Me.txtNRLM) Or Me.txtNRLM = "" Then
Me.txtNRLM = 0
If IsNull(Me.txtLMKGS) Or Me.txtLMKGS = "" Then
Me.txtLMKGS = "0"
If (Me.txtm3 * 333) >= (Me.txtNRLM * Me.txtNRLMKGS) Then ' * * *
Me.lblPayKgs = Me.txtm3 * 333
Me.lblPayKgs = (Me.txtNRLM * Me.txtNRLMKGS)
If Me.lblPayKgs < Me.txtKG Then
Me.lblPayKgs = Me.txtKG
errore FrmAddress, "CalPayKgs"
* * * = .txtm3 is highlighted.
I have tried the following:
Converting the value to a double
Retyping the control name.
Using intellisense to select the control name.
Renaming the control
Deleting the control and readding it.
It's bound to be something really simple, just can't tell what it is.
This code works fine in another part of the app.
Some light for the blind please.