View Assessments - It appears that it does this when the child does not have any assessments already, if they do then the child is continued over:
Code:
Private Sub ViewAssessments_Click()
If IsNull(DLookup("AssessmentID", "tblAssessment", "ChildID=" & Me!ChildID)) Then
DoCmd.OpenForm "AssessmentRecord"
Forms!AssessmentRecord.HoldLiberiID = Me.LiberiID
Forms!AssessmentRecord.HoldChildID = Me.ChildID
DoCmd.Close acForm, "ChildRecord"
Else
DoCmd.OpenForm "AssessmentRecord", , acNewRec, "ChildID=" & Me!ChildID
DoCmd.Close acForm, "ChildRecord"
End If
End Sub
Duplicate ID Messagebox:
Code:
Private Sub LiberiID_AfterUpdate()
If IsNull(DLookup("LiberiID", "tblChild", "LiberiID=" & Me!LiberiID)) Then
Else
Dim Msg, Style, Title, Response
Msg = "This Liberi ID has already been entered onto the system. Please check you have entered the correct ID and the child is not already in the system. Do you want to view the record for the child with this ID?"
Style = vbYesNo
Title = "ID already exists!"
If Response = vbYes Then
Me.Filter = "LiberiID=" & Me!LiberiID
Me.Undo
Me.FilterOn = True
Me.Requery
Else
Me.Undo
DoCmd.GoToRecord , , acNewRec
End If
End If
End Sub
This can be done in VBA in the AfterUpdate of RiskPresent. You are dealing with data this time, not the appearance of controls on the form.
Oh, I see, I'll give that a go too then. Currently checking my code for the Status/CIN etc works under every circumstance.