Jumat, 11 Mei 2012

RE: [MS_AccessPros] Too many checkboxes?

 

Dan-

One alternative would be to have a table that captures each individual option
for an order, but that would then mean you would need to make all your check
boxes unbound and write code to insert the rows one at a time – probably
overkill.

As for testing to see if you need to set NoExtras – assuming each check box is
bound to a Yes/No field, you can do:

If Not(Me.Anchovy Or Me.Mushroom Or Me.ExtraCheese Or Me.Pepperoni Or Me.Sausage
Or Me.Pineapple Or Me.Ham or Me.Onion) Then
Me.NoExtras = True
Else
Me.NoExtras = False
End IF

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----------------------------------

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Dan Fielding
Sent: Friday, May 11, 2012 2:37 PM
To: Yahoo Access Group
Subject: [MS_AccessPros] Too many checkboxes?

 
I'm wondering if it is possible to have too many Check Boxes even though that is
the only way I can envision it.  By way of an easy example, let's say I want to
deal with taking pizza orders and keeping track of things.  I could have the
following:

Pizza Size (small, medium, large)
Pizza Toppings (anchovy, mushroom, extra cheese, pepperoni, sausage, pineapple,
ham, onion, etc.)
Other Items (bread sticks, garlic bread, cinnamon dessert sticks, etc.)

Now, I design a Form with three columns.  I figure the Pizza Size would be an
Option Buttons group.  The Pizza Toppings and Other Items columns would all be
Check Boxes since it would be possible to want multiple choices and I would have
to account for all possibilities.  Just to be sure to capture all possibilities
I might want to create another field called NoExtras which might also be a Check
Box.

In my scenario I would probably want NoExtras to be hidden and code would
determine if it were checked, or not.  So, I would have to create code to check
each Check Box in Pizza Toppings and Other Items.  If none were checked I would
want to programattically check the NoExtras box so I could test for that
condition, as well.

My first question is, other than a series of individual If statements that
checks the condition of each individual Check Box in the two columns is there a
better way to look at all of the Check Boxes at at one time in order to
determine if any are checked?

Actually, in anticipation of what you might be thinking, is this whole approach
of many Check Boxes and testing each one just a crazy way to go about this in
the first place?  If so, what other general designs would you suggest.

Often the hardest part for me when creating a database is figuring out a
reasonable approach.  Part of it is determined by what I know I'm able to do
with an unfortunately limited skill set, and another part is always
second-guessing what I'm doing as I'm doing it and wondering if I should have
headed in a different direction.

Thanks for any thoughts you'd be willing to offer on this.

Dan

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar