I have a contract control number that starts with either AB or TR when it's AB in the "ContractControlNum" field I want the "Contract Status" fields on the form to return 1 and likewise when it's "TR" I want it to return 2.
I place the code below in the "On Current" on the form and it only works when I reopen the form, Not Ideal.
I tryed on After update on the form and nothing.
I tryed on After update on the ContractControlNum field an nothing changed either.
I know the code works just don't know where it should reside!
I'm at a loss for why this does not work.
Dim Lresult As String
If Not IsNull(Me![ContractControlNum]) = True Then
Lresult = Left([ContractControlNum], 2)
If Lresult = "AB" Then
Me![Contract Status] = 1
'1 = In Progress
Else
If Lresult = "TR" Then
Me![Contract Status] = 2
'2 Completed
End If
End If
End If
I place the code below in the "On Current" on the form and it only works when I reopen the form, Not Ideal.

I tryed on After update on the form and nothing.

I tryed on After update on the ContractControlNum field an nothing changed either.

I know the code works just don't know where it should reside!

I'm at a loss for why this does not work.
Dim Lresult As String
If Not IsNull(Me![ContractControlNum]) = True Then
Lresult = Left([ContractControlNum], 2)
If Lresult = "AB" Then
Me![Contract Status] = 1
'1 = In Progress
Else
If Lresult = "TR" Then
Me![Contract Status] = 2
'2 Completed
End If
End If
End If