469,935 Members | 1,924 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Creating New Records with Checked Items

I am working on a form in which I have a shopping list of items that
the user can check off and then beside each they can indicate the
quantity they wish to order. I want each checked item to be a separate
record in the underlying table. I'm just not sure how to use VBA to
pass each of the selected items to a new record in the table. Any
advice?

Nov 13 '05 #1
1 1245
dhildebrandt,
Not so much VBA as SQL. Something like:
"INSERT INTO TEMP_ORDERED_ITEMS_TBL (ITEM_NO, PURCHASE)
VALUES ('100',True);" This would work if you only had one item and had the
values to be added in a stored variable or array. If there is a source
table in the database like an item master table with on-hand quantities then
you can pull items from the item master that show an on-hand quantity that
is equal to or less than the reorder quantity. For example:
"INSERT INTO TEMP_ORDERED_ITEMS_TBL (ITEM_NO, PURCHASE)
SELECT ITEM_MASTER_TBL.ITEM_NO, -1 AS PURCHASE
FROM ITEM_MASTER_TBL
WHERE ITEM_MASTER_TBL.OH_QTY < ITEM_MASTER_TBL.REORDER_QTY"
This is similar to what I do on my Home Accounting database I use for
myself. I've got an .mde of it at
http://home.comcast.net/~knogeek/downloads.htm.

--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS
<dh**********@wrha.mb.ca> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
I am working on a form in which I have a shopping list of items that
the user can check off and then beside each they can indicate the
quantity they wish to order. I want each checked item to be a separate
record in the underlying table. I'm just not sure how to use VBA to
pass each of the selected items to a new record in the table. Any
advice?

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by David Baker | last post: by
10 posts views Thread by dm1608 | last post: by
3 posts views Thread by triplejump24 | last post: by
7 posts views Thread by wqmmnm | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.