Check all that apply

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Anybody who has filled out their share of forms in their life time will be
familiar with a section that says "Check all that apply." I have a paper form
with a field like that which I am trying to turn into an Access form feeding
into an Access table. Any suggestions on the easiest, most convenient way to
do this? In other words, it is one question that may have several answers.

Is there any feild type in Access that will allow you to have several
answers in one column? I've tried entering a lookup wizard along with a list
box, but it doesn't seem to allow you to then set an option to allow several
choices like you can with a normal list box. Any suggestions on how to do
this? Will I just have to have a column in the table for each possible answer
and have them be a yes/no columns?
 
Hi, Paul.

There are a couple of ways to handle this. With a relatively small number
of choices, I might be tempted to have a single table, with each Choice a
Yes/No field type, with a corresponding bound checkbox control on the form.
This is easy to implement because it requires no code.

The other way, which you alluded to, is to populate a list box (LB) from a
table where you've entered all the choices. You must set the LB's
MultiSelect property to "Simple" or "Extended" to permit the selection of
more than one. Then, you will have to execute code to loop through all of
the selections, and insert records for each value. Something like:

Dim intI As Integer
With Me!YourListBox
For intI = 0 to .ListCount - 1
If .Selected(intI) Then
' SQL INSERT statement here
End If
Next intI
End With

Hope that helps.
Sprinks
 
Thanks! This helped a ton! I was able to get this working now.

--
Have a nice day!

~Paul
Express Scripts,
Charting the future of pharmacy
 
Back
Top