Correct use of IF ElseIf

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
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Complex If Statement 6
DELETE IN External DB 4
If Statement 4
Code Is Slow 3
Code Is Slow 6
Code Confusion 10
A Better Way 4
If Statement is Wacky 2

Top