A
anil
hi all
I have 2 tables
tblresult(ResultID,ParameterID,ResultValue,ResultISPass) and
tblParameter(parameterID,ParameterName,P_HIghLimit,P_LowLimit)
Now when i enter the resultvalue in tblResult or frmResult I want that
ResultISPass(checkBox) should be automatically updated.
conditions are
(1) Check for P_highlimit and P_LowLimit - if null then ResultISPass
=Null(3rd state of checkbox)
(2) If Resultvalue<=P_highlimit and ResultValue>=P_LowLimit then
ResultISPass = true
(3) else ResultIsPass = False
I am bit confused that I should use it in query which is not working
fine as
UPDATE tblParameter INNER JOIN tblResults ON (tblParameter.ParameterID
= tblResults.ParameterID)
SET tblResults.ResultIsPass = True
WHERE (((tblResults.ResultValue)<=nz([tblparameter].[P_highlimit]) And
(tblResults.ResultValue)>=nz([tblparameter].[P_LowLimit])));
This also does not consider third state of checkbox.
If I do it in code on update of ResultValue in form as
Private Sub ResultValue_AfterUpdate()
' if P_HighLimit or P_lowLimit = Null then
Me.ResultIsPass = Null
else If (Me.ResultValue.Value <=
Forms!frmparameter!P_highlimit.Value) Then
Me.ResultIsPass = True
Elseif (Me.ResultValue.Value >=
Forms!frmparameter!P_Lowlimit.Value) Then
Me.ResultIsPass = False
End If
End Sub
Here it is giving error in Forms!frmparameter!P_highlimit.Value.
Please help me out
thanks
anil
I have 2 tables
tblresult(ResultID,ParameterID,ResultValue,ResultISPass) and
tblParameter(parameterID,ParameterName,P_HIghLimit,P_LowLimit)
Now when i enter the resultvalue in tblResult or frmResult I want that
ResultISPass(checkBox) should be automatically updated.
conditions are
(1) Check for P_highlimit and P_LowLimit - if null then ResultISPass
=Null(3rd state of checkbox)
(2) If Resultvalue<=P_highlimit and ResultValue>=P_LowLimit then
ResultISPass = true
(3) else ResultIsPass = False
I am bit confused that I should use it in query which is not working
fine as
UPDATE tblParameter INNER JOIN tblResults ON (tblParameter.ParameterID
= tblResults.ParameterID)
SET tblResults.ResultIsPass = True
WHERE (((tblResults.ResultValue)<=nz([tblparameter].[P_highlimit]) And
(tblResults.ResultValue)>=nz([tblparameter].[P_LowLimit])));
This also does not consider third state of checkbox.
If I do it in code on update of ResultValue in form as
Private Sub ResultValue_AfterUpdate()
' if P_HighLimit or P_lowLimit = Null then
Me.ResultIsPass = Null
else If (Me.ResultValue.Value <=
Forms!frmparameter!P_highlimit.Value) Then
Me.ResultIsPass = True
Elseif (Me.ResultValue.Value >=
Forms!frmparameter!P_Lowlimit.Value) Then
Me.ResultIsPass = False
End If
End Sub
Here it is giving error in Forms!frmparameter!P_highlimit.Value.
Please help me out
thanks
anil