Larry,
I think we agree in concept, but perhaps not technique.
I would personally use a multi select list box, and build Where condition
from it; however, this technique takes some pretty advanced string
manipulation. I have one form that drives a complex report selector that has
six multi select list boxes and I build a where condition based on all of
them.
I don't see why you think it would be more error prone, other than the user
entering incorrect numbers. That can be solved a couple of different ways.
As to the Treeview, I avoid ActiveX controls whenever possible. In my years
of experience, they are more trouble than they are worth.
As to the correct way... This is not a case where you can say one way is
correct and another is not, without a hint of arrogance. There are some
issues regarding database design, etc, where correct is more of an absolute.
I will agree that some techniques are pretty bad. For example, there was a
post the other day where someone was putting multiple addresses into one memo
field and wanted to know how to parse them out. That is incorrect. The
solution I proposed in not incorrect. It is, as I previously stated, not the
best. It is a solution I think is not that complese and could be implemented
with a minimum of coding.
Now, if the OP would like to consider using a multi select list box, I will
be happy to share the code I have that does that.
The reason I proposed the solution I did, is that I am not confident the OP
would be able to code something that complex. (Please, no offense to you,
OP). Although the solution I propose is not that elegant, it is not the
difficult for someone of even modest skill to understand and implement.
Larry Daugherty said:
Hi,
I read Klatuu's response and agree with his sympathies but not his
conclusion and suggested conclusion. Since this is not yet an
operational database, better to suffer the extra learning and delay to
do it correctly. By correctly, I mean incredibly more easy to USE and
significantly LESS ERROR PRONE. It is much better that your users
complete their tasks by selecting and clicking rather than entering
data.
I'm predisposed to think in terms of a multiselect list box or a
treeview control. The implementation of either of them is a
non-trivial task.
But, like Klatuu, I'm getting the cart before the horse ...
What is the real world problem you are solving? What is the
application you are designing and what are the strategies you plan to
use?
Please answer the above questions first and then describe your current
design.
Give us the schema if you can. Table and field names and types, etc.
HTH
--
-Larry-
--
Klatuu said:
May I suggest another approach? They way you are doing it will
be
difficult,
because every parameter has to be entered. You could use a list
box
and let
them select the products they want, then use some VBA to write
an
SQL
statement that would return the values, but that would be some fairly advanced
VBA, so I have an idea. I will lay it out assuming you are in a multiuser
environment.
create a table that has two fields, username and product id
When the user is ready to run this routine:
delete the records in this table where the user id = the current user
make a query based on this table the recordsource for your form
or
subform,
but don't show the username.
every time the user enters a product id, do a dlookup on what
they
entered
to ensure it is a valid product. If it is not, prompt them and cancel the
insert. If it is, populate the userid field with their user id.
Have a command button on the form for the user to indicate they
are
done
entering products.
When they click on this button, then it is time to run your query.
Now, the query you are using now will need some modification.
You
will have
to add this new table to the query, join it on product id, and select option
1 in the join properties so only those rows that match will be returned. The
one other thing you will need to do is filter the query on the current user
id.
Good Luck.
:
I am setting up an access 2003 database at work. I need to set
up
one of my
querries with 100 parameters
EX: ([product id 1] Or [product id2] Or ..........up to
[product
id 100]
However with this expression the user must enter 100 values or press enter
the remaining amount of parameters. I understand I can create
10
different
querries each with a differnt amount of parametersin each but
I
feel this
would be confusing to users. I would like Access to ask "is
there
any more
product ids to enter" . Can I do this ? If so How
Thank-You
testtech2522