shabbaranks
Registered User.
- Local time
- Today, 11:49
- Joined
- Oct 17, 2011
- Messages
- 300
Hi all
Im trying to get it so a field within a subform can't be left blank, and if is a message box will prompt them to enter data. I cant change the properties of the table so the field is mandatory as there is already some data in it. My code is
But I can quite happily tab in and out of that column in the subform without adding anything or getting a message - any ideas?
Thanks
Im trying to get it so a field within a subform can't be left blank, and if is a message box will prompt them to enter data. I cant change the properties of the table so the field is mandatory as there is already some data in it. My code is
Code:
Private Sub Cost_Code_LostFocus()
If Forms![MainForm]![SubForm.Form![costcode].Value = "" Or IsNull Then
MsgBox "Please make sure you add a cost code"
End If
End Sub
But I can quite happily tab in and out of that column in the subform without adding anything or getting a message - any ideas?
Thanks