Validation Rule

M

Michael

Hi, Im pretty new to coding in visual basic, so I think this may have an
easy solution

I am setting up a basic validation rule for a form I have designed. The code
(so far) is as follows

Private Sub btn_close_Click()
On Error GoTo Err_btn_close_Click

'VALIDATION RULES ----------------------------------------------------

If IsNull(Me![comments]) And [special_conditions] = "y" Or "Y" Then
MsgBox ("Comments cannot be null if there are special conditions")

'VALIDATION RULES ----------------------------------------------------

Else: DoCmd.Close
End If

I keep getting a type mismatch error which I am sure has to do with the "y"
or "Y" but I am not sure what

Any help would be great

Thanks
 

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

Top