[AccessD] Data-driven option buttons

artful at rogers.com artful at rogers.com
Thu Aug 31 12:43:26 CDT 2006


It turned out to be trivial to populate the labels for the option group. In addition, the large problem with a combo box is that only one option is visible at a time. Given that only one question will be visible at a time, screen real estate is definitely not the issue, so my UI preference opts for an option group -- you can see all the available choices at once, which I deem superior in this context (not all contexts, of course, but in this one). As to simpler, I can't imagine that it gets much simpler than this:

<code>
Private Sub Form_Current()
    With Me
        If Not .NewRecord Then
            .Answers_frame.Visible = True
            .Option5.Visible = Not IsNull(.Answer5)
            .Answer5_lbl.Caption = Nz(.Answer5, "")
             .Option4.Visible = Not IsNull(.Answer4)
            .Answer4_lbl.Caption = Nz(.Answer4, "")
             .Option3.Visible = Not IsNull(.Answer3)
            .Answer3_lbl.Caption = Nz(.Answer3, "")
             .Option2.Visible = Not IsNull(.Answer2)
            .Answer2_lbl.Caption = Nz(.Answer2, "")
             .Option1.Visible = Not IsNull(.Answer1)
            .Answer1_lbl.Caption = Nz(.Answer1, "")
        Else
            .Answers_frame.Visible = False
        End If
    End With
End Sub
</code>


----- Original Message ----
From: Andy Lacey <andy at minstersystems.co.uk>
To: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Sent: Thursday, August 31, 2006 1:03:40 PM
Subject: Re: [AccessD] Data-driven option buttons

My first question, Arthur, would be "can't you use a combo-box"? Be SOOOO
much simpler.

--
Andy Lacey
http://www.minstersystems.co.uk








More information about the AccessD mailing list