Hi - I am not certain what I am doing wrong here. I am testing this code to find if there is a value in a field - if not - I would like to change a certain control to a red color - but I am paused below because I keep getting "YES". Thank you for any help!
Code:
Private Sub Form_Current()
Dim MyDB As DAO.Database
Dim MyDR As DAO.Recordset
Set MyDB = CurrentDb()
Set MyDR = MyDB.OpenRecordset("QueryName", 2)
If IsNull(MyDR.Fields("FieldName")) Then
MsgBox "YES"
Else
MsgBox "NO"
End If