Hi,
I have a main form named as "Test Transaction" and a subform named as "Position Results". I have many fields at main form (may not discuss) and some at subform which are named as:
PositionNo (PK)
TestNo (FK)
TestDate
TResult (Value List includes only Passed/Failed)
Reason (Como box of several reasons if test failed)
I am interested to apply a code that should disable the field "Reason" if "TResult" is passed and vice versa.
Private Sub TResult_AfterUpdate()
If Me.TResult = "Failed" Then
Reason.Enabled = True
Else
Me.TResult.Value = "Passed"
Reason.Enabled = False
End If
End Sub
and at subform on current event
Private Sub Form_Current()
If Me.TResult = "Failed" Then
Reason.Enabled = True
Else
Me.TResult.Value = "Passed"
Reason.Enabled = False
End If
End Sub
I get this code from forum and applied. It works fantastic but the issue is when i starts data entry at main form (1st field) then it started to show the pop up msg " You must enter the a value PositioNo" because when form is loaded the focus is also at subform's field "TResult".
Kindly advise the needful.