Hi All
I have a continuous form which sale staff use to view and schedule calls. This works fine but I now need to limit the number of calls a member of staff can schedule for a particular date to 15. If someone tries to schedule a call and they already have 15 calls for that day a msgbox needs to be displayed and the change cancelled. I thought a Dcount similiar to below would do the job but I can't get this to work.
If I do the Dcount using just the date I get an unexpected number returned not the number of records in the query.
intcount = DCount("*", "QryViewCalls", "[NextCall] = [Forms]![FrmViewCalls]![NextCall] and [CreatedBy] = CurrentUser()")
If intcount => 15 Then
MsgBox "xxxxxx"
DoCmd.CancelEvent
I'd really appreciate any assistance offered.
Thanks
I have a continuous form which sale staff use to view and schedule calls. This works fine but I now need to limit the number of calls a member of staff can schedule for a particular date to 15. If someone tries to schedule a call and they already have 15 calls for that day a msgbox needs to be displayed and the change cancelled. I thought a Dcount similiar to below would do the job but I can't get this to work.
If I do the Dcount using just the date I get an unexpected number returned not the number of records in the query.
intcount = DCount("*", "QryViewCalls", "[NextCall] = [Forms]![FrmViewCalls]![NextCall] and [CreatedBy] = CurrentUser()")
If intcount => 15 Then
MsgBox "xxxxxx"
DoCmd.CancelEvent
I'd really appreciate any assistance offered.
Thanks