access-training-courses - form problem
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

replyReply Fri 2 Nov 2007, 13:35Delegate Paul said...

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?

For upcoming training course dates see: Pricing & availability

replyReply Tue 13 Nov 2007, 15:52Trainer David said...

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

replyReply Tue 13 Nov 2007, 15:56Delegate Paul said...

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*

replyReply Wed 14 Nov 2007, 11:27Trainer David said...

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:

Compact database automoatically

To ensure optimal performance, you should compact and repair your

Open the Access database or Access project that you want Access to compact automatically.
On the Tools menu, click Options.
Click the General tab.
Select the Compact on Close check box.

View all Access hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard