D
DS
Is this If statement correct, meaning, am I missing an end if.
Is the syntax correct?
It seems to be working ok but one never knows
Thanks
DS
If Me.TxtID = 0 Then
DoCmd.OpenForm "FXMsgSelect"
Forms!FXMsgSelect!TxtMsg = "SELECT AN ITEM"
ElseIf Me.TxtAllergyID = 0 Then
DoCmd.OpenForm "FXMsgSelect"
Forms!FXMsgSelect!TxtMsg = "SELECT AN ALLERGY"
Else:
Me.TxtStatus = "DELETE"
Dim DeleteSQL As String
DoCmd.SetWarnings False
DeleteSQL = "DELETE * FROM Allergys " & _
"WHERE Allergys.ItemID = Forms!AllergySetUp!TxtID " & _
"AND Allergys.AllergysID = Forms!AllergySetUp!TxtAllergyID"
DoCmd.RunSQL (DeleteSQL)
DoCmd.SetWarnings True
Me.ListAllergys.Requery
Me.ListAllergys = ""
Me.TxtStatus = ""
Me.TxtAllergyID = 0
End If
Is the syntax correct?
It seems to be working ok but one never knows
Thanks
DS
If Me.TxtID = 0 Then
DoCmd.OpenForm "FXMsgSelect"
Forms!FXMsgSelect!TxtMsg = "SELECT AN ITEM"
ElseIf Me.TxtAllergyID = 0 Then
DoCmd.OpenForm "FXMsgSelect"
Forms!FXMsgSelect!TxtMsg = "SELECT AN ALLERGY"
Else:
Me.TxtStatus = "DELETE"
Dim DeleteSQL As String
DoCmd.SetWarnings False
DeleteSQL = "DELETE * FROM Allergys " & _
"WHERE Allergys.ItemID = Forms!AllergySetUp!TxtID " & _
"AND Allergys.AllergysID = Forms!AllergySetUp!TxtAllergyID"
DoCmd.RunSQL (DeleteSQL)
DoCmd.SetWarnings True
Me.ListAllergys.Requery
Me.ListAllergys = ""
Me.TxtStatus = ""
Me.TxtAllergyID = 0
End If