Connecting Tech Pros Worldwide Help | Site Map

Creating New Records with Checked Items

dhildebrandt@wrha.mb.ca
Guest
 
Posts: n/a
#1: Nov 13 '05
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?

Alan Webb
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Creating New Records with Checked Items


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
knoNOgeek@SPAMhotmail.com
"It's not IT, it's IS
<dhildebrandt@wrha.mb.ca> wrote in message
news:1115309864.256952.72700@z14g2000cwz.googlegro ups.com...[color=blue]
>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?
>[/color]


Closed Thread