-
If then else question
Hello everyone,
I know there are a million posts about this question, but I have another one. I will preface this by saying I am not a programmer and had this project handed to me by my supervisor, so I apologize if the code looks ugly.
I am attempting to automatically update a record when a form is completed. There are two fields I am trying to update, the first one is working perfectly [Class of Arrest], however the second one [Class of Report] is not updating the field at all.
I appreciate any assistance anyone can provide.
Private Sub Class_of_Arrest_Click()
If [CRIA Felony Arrest] > 0 Or [Non-CRIA Felony Arrest] > 0 Then
[Class of Arrest] = "Felony"
ElseIf [CRIA Misdemeanor Arrest] > 0 Or [Non-CRIA Misdemeanor Arrest] > 0 Or [CRIA Domestic A B Arrest] > 0 Or [Non-CRIA Domestic A B Arrest] > 0 Or [CRIA Mental TDO] > 0 Or [Non-CRIA Mental TDO] > 0 Then
[Class of Arrest] = "Misdemeanor"
End If
End Sub
Private Sub Class_of_Report_Click()
If [CRIA Felony Report] > 0 Or [Non-CRIA Felony Report] > 0 Then
[Class of Report] = "Felony'"
ElseIf [CRIA Misdemeanor Report] > 0 Or [Non-CRIA Misdemeanor Report] > 0 Or [CRIA Domestic Report] > 0 Or [Non-CRIA Domestic Report] > 0 Then
[Class of Report] = "Misdemeanor" > 0
Else
[Class of Report] = "Supplement"
End If
End Sub
-
Hi -
The only this I see wrong is this:
[Class of Report] = "Misdemeanor" > 0
This sets [Class of report] to True or False.
It should of course be : [Class of Report] = "Misdemeanor"
Other than that, I don't see anything wrong with the code. If it still doesn't work, then you may have a problem with the data.
John
-
Thanks for the assist John - looks like it was just a typo. I appreciate it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules