Re: Best Way To Design Form w/Hundreds of Yes/No Fields
- From: "Randy Birch" <rgb_removethis@xxxxxxxx>
- Date: Thu, 1 Sep 2005 22:30:21 -0400
Two options ...
1) Create the demo at http://vbnet.mvps.org/code/forms/scrollform.htm,
reading the text carefully. Then delete the demo controls (all but the
picturebox and scroll bars), and after the Dim statements in the form load
event, add:
Call LoadControls
Add this procedure:
Private Sub LoadControls()
Dim cnt As Long
Dim tHeight As Long
Me.FontName = Label1(0).FontName
Me.FontSize = Label1(0).FontSize
tHeight = Me.TextHeight("H") + 50
For cnt = 0 To 99 '100 controls
If cnt > 0 Then
Load Label1(cnt)
Load Check1(cnt)
End If
With Label1(cnt)
'replace with code to present
'question on one line
.Caption = "this is label #" & cnt
.AutoSize = True
.Move 200, 200 + (tHeight * cnt)
.Visible = True
End With
With Check1(cnt)
'replace with code to present
'question on one line
.Caption = "Yes (#" & cnt & ")"
'the '4000' will need tweaking depending
'on how wide the questions are
.Move 2500, 200 + (tHeight * cnt), 4000
.Visible = True
End With
Next cnt
End Sub
Run the app. You should get 100 labels w/ text and 100 check boxes the user
can check for Yes. The user can scroll the questions into view, etc.
2) Use http://vbnet.mvps.org/code/intrinsic/matrixcheck.htm. This will
require some reworking to suit, but it uses 1 control (a picturebox) to
simulate any number of checkboxes. The questions could be presented
one-at-a-time in response to the user clicking on a particular box. This
method allows the user to check all by just clicking the header. If you
rework the code to provide a brief question in place of the row labels,
clicking that would also click the box. Without modification this method
also lends itself to computer-generated answer forms where the questions are
presented elsewhere (on paper or on another form for example). I recommend
you at least create the demo and try it for fun.
--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
----------------------------------------------------------------------------
Read. Decide. Sign the petition to Microsoft.
http://classicvb.org/petition/
----------------------------------------------------------------------------
"bmccollum" <bmccoll1@xxxxxxxxxxxxxxx> wrote in message
news:1125509035.673707.70900@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
: I'm working on designing a data entry form for a client. This
: particular data entry form will have literally hundreds of survey
: questions on it that require a yes/no indication by the user.
:
: I'm trying to avoid having to implement literally a hundred or so
: individual yes/no option button items on the form and having to
: type-out hundreds of individual survey questions and would like to just
: lump all of these questions into a single table and then have some sort
: of scrolling capability or control to present all of the questions to
: the user and allow them to quickly click yes/no.
:
: Any ideas here?
:
: Thanks!
:
: Brad McCollum
: bmccoll1@xxxxxxxxxxxxxxx
:
.
- References:
- Best Way To Design Form w/Hundreds of Yes/No Fields
- From: bmccollum
- Best Way To Design Form w/Hundreds of Yes/No Fields
- Prev by Date: Re: Best Way To Design Form w/Hundreds of Yes/No Fields
- Next by Date: Re: Copy A:\ to C:\ Folder
- Previous by thread: Re: Best Way To Design Form w/Hundreds of Yes/No Fields
- Next by thread: Execute programs with different user
- Index(es):
Loading