Hello,
I have a command button and two option buttons. I am trying to have a warning box appear when someone uses the command button without selecting either of the two options, option38 and option40.
The command button loads a new item from the database. I want a warning to aleart the user that they have not selected either one of the required options before proceeding to a new item from the database.
I built a warning box and have it set to pop up a reminder to double check the option boxes every time the command button is used, but this is tedious to the user.
Any help appreciated.
Are the options bound to a field in a table? If so, make the field in the table required. Access will not let the record be saved or closed if an option is not selected. Also make sure that there is no default value for the options or this will not work.
Alan
Alan
Click the * below to say thanks.
Database Principles
Pivot Table Tips
Good Excel Video Tutorials
Sumifs or SumProduct
DataPig Access Tutorials
MS Query Tutorial
Worst Pie Chart Ever?
The actual code to test if an option button has been toggled is just a boolean test:
If option38 = False then
Is your code running too slowly?
Does your workbook or database have a bunch of duplicate pieces of data?
Have a look at this article to learn the best ways to set up your projects.
It will save both time and effort in the long run!
Dave
Hello,
I took your advice and tried making the field required. Because people import the data as an amended table to work on via Excel, it appears the requirement is causing an error and preventing the import to complete.
Both option38 and option40 input a 1 or 2 into a check column on the data table.
I did try it as a new table but it still allows me to enter a new search without selecting either option38 or option40 first...any other suggestions?
Hi Dave- I assume that is only part of the code?
It would be followed by a message box?
Is this something that could handled with a validation code and if so could someone help me with the code structure?
I need it to make something that will work even when the datatable is amended several times by importation of Excel files.
if option38 = False then msgbox "You didn't click option 38.",vbokonly exit sub
Is your code running too slowly?
Does your workbook or database have a bunch of duplicate pieces of data?
Have a look at this article to learn the best ways to set up your projects.
It will save both time and effort in the long run!
Dave
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks