I am making a Work Order system for my company. What I am trying to do is that if the AssignedTo field is not empty, then the DateScheduled field is required.
I think its a VBA NotNull command but I am not sure and what I have tried is not working.
I am making a Work Order system for my company. What I am trying to do is that if the AssignedTo field is not empty, then the DateScheduled field is required.
I think its a VBA NotNull command but I am not sure and what I have tried is not working.
Probably something like this in the form before update event
Code:If Not IsNull(Me.AssignedTo) And IsNull(Me.DateScheduled) Then MsgBox "DateScheduled is a required field" Cancel = True Me.DateScheduled.SetFocus End If
If this helped, please click the star * at the bottom left and add to my reputation- Thanks
That didn't work. I used the BEFORE UPDATE on the Date Scheduled field in the form because the work order will be created. Then it will need to be assigned later, so someone will go into the form later and assign it to someone.
When it gets assigned I want them to need to put in a date and then the status goes to assigned, but I did figure it out based on your reply, so Thank You!
I used the Assignedto field and did this:
sub AssignedTo_AfterUpdate()
if not isnull(me.assignedto) then
me.datescheduled = date
me.jobstatus = "assigned"
end if
and that worked!!!