Joe Hecht
jmhla at earthlink.net
Mon Mar 21 22:58:03 CST 2005
I have a sub form where I need to do some logic checking. sfrmSampleSize User either selects all pieces (ChkAllPieces), a yes no field , txtPieces, a numeric txt box, (txtPieces) or N/A, (chkNA). If more then one field is changed from 0 or not selected I run the following code. Private Sub ChkAllPieces_AfterUpdate() DoCmd.SetWarnings False If Me.txtPieces.Value <> 0 Or Me.chkNA.Value = True Then Dim lngRetval As Long lngRetval = MsgBox( _ "You have selected conflicting instructions." & vbCrLf & "" & vbCrLf & "Please select one only:" & vbCrLf & "" & vbCrLf & "All samples, A number of samples or N/A" & vbCrLf & "" & vbCrLf & "", _ vbOKOnly + vbExclamation + vbDefaultButton1, _ "Conflicting Instructions") Select Case lngRetval Case vbOK End Select End If Me.txtPieces.Value = 0 Me.ChkAllPieces.Value = 0 Me.chkNA.Value = False DoCmd.SetWarnings True End Sub Problem : I can no longer set value of chkAllPieces to true. It automatically changes back to unchecked. Can anyone tell me why? Thanks Joe