null values for radio buttons

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rcollins
    New Member
    • Aug 2006
    • 234

    null values for radio buttons

    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
  • Dan2kx
    Contributor
    • Oct 2007
    • 365

    #2
    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
    Code:
    Dim msg as string 
    if IsNull(me.RadioButton1) then msg = msg & "RadioButton1" & vbcrlf
    if IsNull(me.RadioButton2) then msg = msg & "RadioButton2" & vbcrlf
    'etc
    
    If not msg = "" Then 
         msgbox "You have not completed all options:" & vbcrlf & msg
    exit sub
    Else
         GoTo Code1
    End if
    
    Code1:
         'Do your code/next record

    Comment

    • OldBirdman
      Contributor
      • Mar 2007
      • 675

      #3
      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.Enabl ed = 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?

      Comment

      • rcollins
        New Member
        • Aug 2006
        • 234

        #4
        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.

        Comment

        Working...