How to create a duplicate popup message

deckspin74

New member
Local time
Today, 05:22
Joined
Jun 21, 2005
Messages
6
Hi,

I have created a database for my department which allows management to view staff training. In one particular form, the operator (management) can select a certain staff members name from a combo box and view what training that member has completed via a subform. Also in this form the operator can press a button to open another form which allows them to add a new completed training course for that member of staff. When all the fields in this form are completed the form can be closed and the new training course is automatically added to the subform of the first form.

What I would like is to create a personalised error message for duplicate training courses, if the member has already completed that course. I have searched on this forum and tried many of the solutions which other people required. But these didn't seem to work.

I should mention what the second form looks like.... When the training course form is opened from the first form, it shows the members name and staff number. The operator can select a training course from a combo box. Also on the form is a complete date field.

I've tried to put some vb in the before or after update event field of the form but with no luck of working. Anyone with some pointers for me?
 
deckspin74 said:
The operator can select a training course from a combo box

what I usually do in these situations is not show the option that has already been selected in the combo box. That removes the issue of showing a message.

I recently posted an example here:

This is from a database currently in use, you can move the units from one department to the other with the two combo boxes on the left along the bottom of the form. If you experiment with this example, you will see that once you have moved all of the units from one department to another they no longer appear listed in the combo box.
 
Hi Uncle Gizmo,

Thanks for the reply. I had a quick play of your little program and it looks great. But I don't think its quite what I want for my program. On mine, the operator can select a training course for each member. This can be the same course for 1 or more members. So if I used your example, I would be able to select a course for one member but when I selects another member that course would have disappear from the selection screen, because the last member had selected it.

I maybe looking at your program wrongly. Is this the case?

Sorry for the long delay on replying. Just come back from a long weekend break.
 
The impression I got from your original post was that you have a problem when management was trying to enter the same course twice. And you needed a message box to prevent this happening.

I think you could adapt my example to work, in this case, but obviously it will not work for multiple students.
 
Hi Uncle Gizmo,

I read my first post again. It maybe a bit misleading, but I did write this in the early hours of a night shift which I was on.

Your first part was correct, I am trying to stop management from entering the same course twice, but for each student not the whole department. In a way its obvious that there will be more than 1 student attending a course. What I have at the moment is a combo box of courses in the second form. It would be great if a course would disappear from the combobox if that student has already completed the course. But the course appears in the combobox if another student hasn't completed the course.

I was using the duplicate message case, as I could not work out how to hide the course from the combobox.
 

Users who are viewing this thread

Back
Top Bottom