I am creating a form to track customer contact in.
I want to ma a field mandatory using VBA but don't know where to start.
The
I am creating a form to track customer contact in.
I want to ma a field mandatory using VBA but don't know where to start.
The
I submitted before I typed everything. I want to make the field "outcome" mandatory and want it so the form cannot be saved without this being completed first.
My current VBA Is
Private Sub Command165_Click()
DoCmd.GoToRecord , , acNewRec
Customer_ID.Value = ""
Chat_Type = ""
Staff_Name = ""
Reason_for_Chat = ""
Reason_2 = ""
Reason_3 = ""
Free_Text = ""
Feedback = ""
Outcome = ""
txtDates.Value = Format(Date, "dd/mm/yyyy")
txtDates.Locked = True
txtTimes.Value = Format(Time, "HH:MM:SS")
txtTimes.Locked = True
End Sub
This may help, but I'd also make the field required in the table.
http://www.baldyweb.com/BeforeUpdate.htm
Thanks for the support. I tried this in a few different places and either it didn't validate or it came up with an error.This may help, but I'd also make the field required in the table.
http://www.baldyweb.com/BeforeUpdate.htm
Like I said, I'd make the field required in the table. As you your error, I can't say without seeing your exact code and where you put it.
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007