B
Bob
Before I can delete a client out of my SubForm I want a code to check that
it has at least 1 other client other wise you can not delete the last client
connected to that horse
Table is: tblHorseDetails
The 3 fields are OwnerID , HorseID & OwnerPercentage
What I want is when I delete OwnerID from that HorseID (I need a code to
check that, that HorseID has at least 1 OwnerID) (Never Mind about
Percentage)
What I am trying to do is to stop a Horse having no OwnerID because it
causes HAVOC later on
----------------------------------------------------------------
Current Dode:
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click
Dim nRtnValue As Integer
nRtnValue = MsgBox("Are you sure you want to ((Delete)) this Client ?" &
vbCrLf & vbCrLf & "Horses must have at least one Client!", vbCritical +
vbYesNo, "Delete Client")
If nRtnValue = vbYes Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_Command13_Click:
Exit Sub
Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click
End If
End Sub
it has at least 1 other client other wise you can not delete the last client
connected to that horse
Table is: tblHorseDetails
The 3 fields are OwnerID , HorseID & OwnerPercentage
What I want is when I delete OwnerID from that HorseID (I need a code to
check that, that HorseID has at least 1 OwnerID) (Never Mind about
Percentage)
What I am trying to do is to stop a Horse having no OwnerID because it
causes HAVOC later on
----------------------------------------------------------------
Current Dode:
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click
Dim nRtnValue As Integer
nRtnValue = MsgBox("Are you sure you want to ((Delete)) this Client ?" &
vbCrLf & vbCrLf & "Horses must have at least one Client!", vbCritical +
vbYesNo, "Delete Client")
If nRtnValue = vbYes Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_Command13_Click:
Exit Sub
Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click
End If
End Sub