By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,045 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,045 IT Pros & Developers. It's quick & easy.

null values for radio buttons

P: 234
I have a form that generates a list of questions. These questions are answered by "Yes", "No' and "NA". (Database was built by someone else)
I was asked to make modifications to the database. First, to make "No" not default value, they do not want any answer picked by default. On the table field for the radio button, I changed the default value from 0 to empty and that worked. Now, along with this change, if the user answers questions, some may be missed on accident. They would like when they save the form for it to let them know that there are epty answers. If I change this in the table by setting the Required field to Yes, then none of the info shows up on the formwhen I open it. Am I doing something wrong? Thanks
Feb 24 '09 #1
Share this Question
Share on Google+
3 Replies

P: 365
I'm not an expert but a simple solution in my mind would be to use some code on a button click to evaluate the radio buttons for example
Expand|Select|Wrap|Line Numbers
  1. Dim msg as string 
  2. if IsNull(me.RadioButton1) then msg = msg & "RadioButton1" & vbcrlf
  3. if IsNull(me.RadioButton2) then msg = msg & "RadioButton2" & vbcrlf
  4. 'etc
  6. If not msg = "" Then 
  7.      msgbox "You have not completed all options:" & vbcrlf & msg
  8. exit sub
  9. Else
  10.      GoTo Code1
  11. End if
  13. Code1:
  14.      'Do your code/next record
Feb 25 '09 #2

P: 675
I am usually annoyed when I press a button on a form and am told, by msgbox, that I shouldn't have pressed it. If you want a completed form, then set cmdFinish.Enabled = False until all items are complete. Easy way is to count NumberCompleted until it reaches the total number of questions, or count down to zero. We are all used to this as it is frequently used on web surveys, etc.

Access Help subject = "Required Property" says that the data must be present and not null. If it isn't, the record is not written (saved). If not written, then won't show up on form when opened.

Why would you want to save an incompleted record anyway? You're saying that all data is required. Am I missing something?
Feb 25 '09 #3

P: 234
Sometimes they scroll too far past the next question therefore scipping some. They need to answer all questions so they get an accurqate survey result. So we do not want incoplete records, that is why I want to check that all have been answered. I will give the count thing a try.
Feb 25 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.