By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,446 Members | 3,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,446 IT Pros & Developers. It's quick & easy.

Creating New Records with Checked Items

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.