access-training-courses - form problem

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access Training and help » access-training-courses - Form problem

access-training-courses - Form problem

resolvedResolved · Low Priority · Version Standard

Paul has attended:
Access Intermediate course
Access Advanced course

Form problem

I want to have an error message pop up if I select something from a drop down menu that has already been selected in a different record on the same form. Any ideas?

RE: form problem

Paul,

I assume you want the error message to come up and actually stop them from using that option. If it was me I would go about this in a slightly different way. I would create another table with the options in, with a column for the option, a column for the ID and a column for a Boolean value of true or false. Then using VBA I would populate the drop list using the options where in the Boolean column the value is false. Then when you select an option it will set the value in the Boolean column to true and will no longer appear in the drop down list.

By using this method you will not present your users with an option they cannot use, and there will be no need for an error message.

However if you want to stick to your original idea I would use VBA and a query to find out if any other record has used the option you just select if they have then show error message and if it is not used then allow.

Hope this helps
David

RE: form problem

Hi David. I think the boolean value sounds like a good idea. I'll just have to work out how to use vba now.

This project is beginning to grow faster than I'm learning *gulp*

RE: form problem

Paul,

If you have had no experience of VBA before it may be worth you have a look at our VBA course. If this is the kind of thing you will be doing on a regular basis, then the VBA course may be worth it.

Any problems with the implementation let me know

David


 

Access tip:

Splittng a database

Split your database into two (at least).

Keep all of your code, forms, reports, etc. in one 'code' database and all of your tables in another 'data' database which is then linked to the 'code' database.

This makes modifications, updates and back-ups that much easier and allows you to work on a new version of your 'code' database without affecting existing users. It also makes it easier should you wish to convert a single user databases into a multi-user networked version.

View all Access hints and tips


Server loaded in 0.08 secs.