Stang70Fastback
Registered User.
- Local time
- Yesterday, 19:22
- Joined
- Dec 24, 2012
- Messages
- 132
Hello all! Simple question. I have the following code:
It works perfectly fine when the Me.DisciplineCOM field is a string such as "Architect" or "Civil", but I run into issues when the field is a string such as "QA / QC" or "Mechanical / Plumbing."
It's clearly an issue with the forward slash. I've tried "escaping" the forward slash using Replace(Me.DisciplineCOM, "/", "///") but that still doesn't work. What am I doing wrong? How do I resolve this issue WITHOUT renaming the fields themselves?
Thanks guys!
Code:
If DCount("Employee", "ManpowerDataEmployee3", "Discipline = '" & Me.DisciplineCOM & "'") <> 0 Then
DoCmd.OpenReport "ManpowerSummaryDiscipline", acViewPreview, , "Discipline = '" & Me.DisciplineCOM & "'"
DoCmd.Maximize
Else
MsgBox "There are no engineers currently assigned to this discipline.", vbInformation, "No Engineers"
End If
It works perfectly fine when the Me.DisciplineCOM field is a string such as "Architect" or "Civil", but I run into issues when the field is a string such as "QA / QC" or "Mechanical / Plumbing."
It's clearly an issue with the forward slash. I've tried "escaping" the forward slash using Replace(Me.DisciplineCOM, "/", "///") but that still doesn't work. What am I doing wrong? How do I resolve this issue WITHOUT renaming the fields themselves?
Thanks guys!