Update query using values from list box

J

Jen

I'm trying to allow a user to select several values in a
list box (on a dialog box form), then use these values as
criteria for an update query.

I have successfully concatenated the list box values and
stored them in an invisible text box (txtCriteria) on the
dialog box. The value in this text box looks something
like
"MBI 426-" OR "MBI 444A" OR "MBI 542-"

On my dialog box, clicking OK concatenates the values and
stores them in the text box. Then, it runs the update
query.

The update query is set up to select for Forms!DialogBox!
txtCriteria, and update these records to reflect the
current date in another field. However, whenever I run
the update query it finds 0 rows.

Has anyone done this successfully, or have any pointers?
 
M

MGFoster

Jen said:
I'm trying to allow a user to select several values in a
list box (on a dialog box form), then use these values as
criteria for an update query.

I have successfully concatenated the list box values and
stored them in an invisible text box (txtCriteria) on the
dialog box. The value in this text box looks something
like
"MBI 426-" OR "MBI 444A" OR "MBI 542-"

On my dialog box, clicking OK concatenates the values and
stores them in the text box. Then, it runs the update
query.

The update query is set up to select for Forms!DialogBox!
txtCriteria, and update these records to reflect the
current date in another field. However, whenever I run
the update query it finds 0 rows.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

There is a MS Knowledge Base article that describes how to use a list of
prompted values in a query. You can probably change it to get the
criteria values from a List Box.

ACC: How to Create a Parameter In() Statement

http://support.microsoft.com:80/support/kb/articles/Q100/1/31.asp


I've posted a function that gets the bound column values from an
Extended select ListBox. Search Google for the string "getIDs(lst" and
author MGFoster, on this newsgroup.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQIAhOIechKqOuFEgEQLgkQCeLYec3hcEpc+rBTbOU1eswIQ2Y9YAn0eO
ODvEiBMWgdLo8yOHrG5h2vPN
=dGKU
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top