Validation Rule for Yes/No Fields

OK - I've been messing around with this for a couple of hours and can't get it to work. I added Question1, Question2, and Question3 to the table and put the question in as a default value so when the form opens it looks the same to the user. I then added the yes and no check boxes, changed the name in the properties of each to chkYes and chkNo and put the StableTransfer-Yes (which is the yes no field I want filled) and made it not visable. I then put the code in for the Yes checkbox like this:

If M.chkYes = -1 Then
Me.chkNo = 0
Me.chkStableTransfer-Yes = -1
Else
Me.chkNo = -1
Me.chkStableTransfer-Yes = 0
End If

Then did the same for the No Checkbox:
If Me.chkNo = -1 Then
Me.chkYes = 0
Me.chkStableTransfter-Yes = 0
Else
Me.chkYes = -1
Me.chkStableTransfer-Yes = -1
End If
End Sub

It doesn't work - you can check both boxes without something stopping you and it doesn't register in the table. I have no idea what I'm doing wrong.It looks just like what you did and is set up the same way but no go. Did I miss something?


Laura

which event did you use?
 
Laura,

If you do not have a solution shortly, I am working on a demo of this. I think it has some potential for all of us to learn a few things.

I will say, if I understand what you are saying that you have done not, that creating the additional fields for each Question is not what I was suggesting. You could add as many Questions to your table as you need. Each Question is a new record. You will also need to have a QuestionNum field which will be number type field defined as Byte type. You can use this field to sort the questions.

HTH
 
Laura,

I am sure you may have found a solution to your issue for having both a Yes and a No check box for getting answers to questions in a survey.

However, I did creat a test database that will do what you want to do. Some of the things that I finnally did may not meet all of your criteria but, oh well, at least I can make it work. LOL

Here are a few things that I did change from what has been discussed in this thread:

1. I changed the "Answer" field from a Yes/No type field to a number field with a type of Byte. The values that will be allowed for this field are: 0 = no answer (this is the default and will be the value when the user starts to take the test), 1 = a Yes answer and 2 = a No answer.

2. I turned the form into a "Answer One Question at a Time" type presentaton. You will see how this works when you down and try out the attached demo file.

3 I also create a Question management form where you can add, edit, delete and change the sort order of the questions.

Take a look and let me know what yo think.

HTH
 

Attachments

Hello - I will look at what you've made today and see if I can incorporate it in. I was using the code in the After Update event - I believe that's the right event.

I'll get back to you to let you know if I can do it.

Thank you so much for all your help.

Laura
 
Laura,

As I eluded to in my previous post, I discovered some flaws in some of the proposals that have been made in this tread and had to make some adjustments in what I thought would work and then found that there were issues that made it either impossible to do or just was not clean enough to be usable.

I find that it is always very easy for me to give some off the cuff advice about how to do something, or even when I am developing a solution for client, and then when I start to actually implement the solution, I find that there were things that I just did not envision. That happened with this issue. Having the two check boxes to answer one question with seemed simple enough at first, but as it turns out, there was a little more to the issue.

Please post back and let me know your thoughts about my approach to solving the issue. I did not provide for all of the things that I thought of while I was fooling around with creating the example database, but hopefully it will help you and even others out.
 
Hello. I spent some time looking at the sample db to manage questions but I really think that is way to complex to fit in with the form and users for what I'm making. It has taught me much and I will keep it for future use but I believe that the best method for the users I have is to just put a togle switch with instructions in parenthases next to it. Since there isn't a way for me to send you the database I've build (as it's too big) it's difficult for you to see the queston in context to the form. I appreciate all the work you have done more than you'll know because I am continually learning from people on this forum.

You guys/gals are the best so thank you for being here to help.

If there is a way to send you my database so you could see what I'm talking about let me know.

Laura
 
Well, there is a way to send me large files, but you would have to contact me directly for that. If you want to go to my website (below my signature) you can send me an email from there. From that we can see about looking at the database your have developed.
 

Users who are viewing this thread

Back
Top Bottom