I have a set of questions with yes/no options.
How do I check if these are answered when close button is clicked in the form.
Thanks.
I have a set of questions with yes/no options.
How do I check if these are answered when close button is clicked in the form.
Thanks.
What does answered for a yes/no field mean? A yes/no field is either True or False, has to be one or the other. The default unless specified otherwise is False. Leaving the default could be a valid response. So how should one know if the field was not answered?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Actually its a form with questions,and the end user can only access form and print it as is,so they should select a button before closing.
I don't understand. That does not change my comment.
Select a button for what?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
June7's comment goes right to the heart of the problem...if the user doesn't tick the Checkbox, it already has a value, so doing validation to ensure that the Control is populated is useless...because it is populated, by default!
To be able to verify that a choice has been made, instead of a Checkbox, you need to use a Combobox with two values, Yes and No. If no choice is made, the Combobox will be Null, which you can test for.
Alternatively, you could use an Option Group with two Checkboxes or Radio Buttons, one for 'yes' and one for 'no,' and validate the same way.
The 'close form' button should just do that...close the Form; the validation code would then go in the Form_BeforeUpdate event, where the update can be cancelled if the required Controls aren't populated..
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007
Linq, I think a combobox and option group will also show No/False as default value if they are bound to the field, at least does in my test, so that still will not resolve the issue.
Probably need to use text or number instead of yes/no type field.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.