468,539 Members | 1,737 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,539 developers. It's quick & easy.

Write to and store data in a listbox

I have a form that screens the database. I build a dynamic WHERE
clause into a string and apply it to the form's filter.

I want to allow the user to save, say, five or 10 of their most-used
WHERE clauses. I would like to prompt them to name the clause
something useful when they save it. I want to save these clauses into
a 2 column list box with only the description column showing (no need
for them to see all the SQL).

I need to be able to bring the saved clauses up each time the user
uses the form. I also need a way to delete any clauses no longer
wanted as well as limit the amount of saved clauses at any one time
(10 maximum).

Any ideas?

Thanks for the help in advance.

Troy Lee
Aug 24 '08 #1
2 3436
tr******@comcast.net wrote in
news:85547056-aa3f-42f7-9e58-50f50e002cc1
@e39g2000hsf.googlegroups.co
m:
I have a form that screens the database. I build a dynamic WHERE
clause into a string and apply it to the form's filter.

I want to allow the user to save, say, five or 10 of their
most-used WHERE clauses. I would like to prompt them to name the
clause something useful when they save it. I want to save these
clauses into a 2 column list box with only the description column
showing (no need for them to see all the SQL).

I need to be able to bring the saved clauses up each time the user
uses the form. I also need a way to delete any clauses no longer
wanted as well as limit the amount of saved clauses at any one
time (10 maximum).

Any ideas?

Thanks for the help in advance.

Troy Lee
"I want to save these clauses into a 2 column list box"
List boxes do not save data. Tables are the only place to store
data.

Build a table with 3 or more columns: UserID, Description,
whereClause (necessary) , dateCreated, countOfUsage (optional)

Populate the listbox from the table. You will need buttons on the
form, near the listbox to "delete selected Filter" and another to
Save New Filter.

to limit the number of records, use a Dcount() call to determine if
there are already >= 10 rows for UserID, popup a message if true,
run an SQL insert to the table if false.

--
Bob Quintal

PA is y I've altered my email address.
** Posted from http://www.teranews.com **
Aug 24 '08 #2
On Aug 24, 3:21 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
troy_...@comcast.net wrote in
news:85547056-aa3f-42f7-9e58-50f50e002cc1
@e39g2000hsf.googlegroups.co
m:
I have a form that screens the database. I build a dynamic WHERE
clause into a string and apply it to the form's filter.
I want to allow the user to save, say, five or 10 of their
most-used WHERE clauses. I would like to prompt them to name the
clause something useful when they save it. I want to save these
clauses into a 2 column list box with only the description column
showing (no need for them to see all the SQL).
I need to be able to bring the saved clauses up each time the user
uses the form. I also need a way to delete any clauses no longer
wanted as well as limit the amount of saved clauses at any one
time (10 maximum).
Any ideas?
Thanks for the help in advance.
Troy Lee

"I want to save these clauses into a 2 column list box"
List boxes do not save data. Tables are the only place to store
data.

Build a table with 3 or more columns: UserID, Description,
whereClause (necessary) , dateCreated, countOfUsage (optional)

Populate the listbox from the table. You will need buttons on the
form, near the listbox to "delete selected Filter" and another to
Save New Filter.

to limit the number of records, use a Dcount() call to determine if
there are already >= 10 rows for UserID, popup a message if true,
run an SQL insert to the table if false.

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**
Thanks Bob for the quick response. I should have thought of this.
Thanks for pointing out my obvious error about storing the WHERE
clauses in a listbox.

This sounds promising. I will definitely give it a try. Thanks.

Troy Lee
Aug 24 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jared | last post: by
3 posts views Thread by Uma sakshi | last post: by
1 post views Thread by A. Spiehler | last post: by
reply views Thread by Svenn Bjerkem | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.