View Full Version : Close window, check boolean


Paul_Atreides
12-04-2009, 06:46 AM
Hey guys
I am really new to access and I was looking for some help. I need a macro to run when I close a certain form, and then check to see if a boolean is checked more than once. I have different years and I would like to have one year be current. I can select current via a check box, and I would like the macro to check to see if the checkbox is checked two or more times. If it is a need it to return a message box and then re open the form. I am having a hard time specifying the form that closes, and also checking the error. I appreciate any help I can get on this. Thanks.

wiklendt
12-06-2009, 03:17 PM
not sure i understand... do you mean you have checkboxes on your form for each year of your data, and the user checks one of these to be the "current" year for data manipulation?

what happens each new year? do you go into the form and re-design it to include a checkbox for the new year?

if so, you are better off using a combo box which uses a query to find all the years your data currently uses - by default the user will only be able to display (and therefor 'use') one of these. the combo will always have up-to-date data in it and you save yourself painfully adding code each year to handle new years as they come.

let me know if i have misunderstood...

Paul_Atreides
12-07-2009, 09:59 AM
Hey,
Thank you for your response. I am sorry I was not more specific with the design. I have a combo box that the user an select the year. 2004-2005, 2005-2006 etc. Below that I have a check box with the label current year. It is checked when the current year is selected. I am trying to have the macro check to see if multiple years are selected and then send a message box and re open the current year form. Again thanks for the response.