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

Passing varitables from sql to vba...

P: 2
"Hi i created an access 2003 dmb that tracts inventory by a production number. Now i need a way to decrease the inventory as it gets removed from inventory which a clerk would input.

i know the basics of how it would be done but im not sure how to call the sql function i would need to write.... or even how to write the sql function, and even then how to call the sql value to vba...basically im lost

Here was my idea and maybe you can help?

I would create a form where they would Input the production number then they would input a number that would reflect how much of that specific item to deduct from inventory.

then it would find that record.

It would subtract the number they input from the value of the number of items in the inventory

If the inventory is 0 or less 1 I want to delete the record
if it is above 0 i want to update that record.

my problem is that i don't know how to A) find that specific record ( i can query it easy but i cant pass the value..) passing the argument to vba

and then i don't know how to delete the record in vba or update

pretty much i don't know how to do anything anymore cause i haven't done vba in about 3 years :(
Jul 20 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 2.5K+
P: 3,072
In general updating the inventory is a bad idea.
I always "calculate" the inventory by having a query summingup the inventory with the deliveries and subtracting the qty's delivered.

After a year (or shorter) period the books will have to be closed and a warehouse count will give the new "real" inventory.
This way the difference between the calculated value and the ral value can reveal "leakage" and you're sure the administration is "in-line" again.

Idea ?

Aug 1 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.