View Full Version : Permentant VBA background table checks


micksitup
05-08-2007, 11:23 AM
Hi,

If i need a live reminder should a figure drop below a certain amount, how could i achieve this in vba.

An input form full of products reduces the stock used to create the product. how can i get a live reminder should stock fall below a paticular level?



If this is too vague, i can give more detail

Cheers

rainman89
05-08-2007, 11:30 AM
is there a instock field in a table you have?

micksitup
05-09-2007, 04:47 AM
Yes. There is:-

Stock Level
Current Stock level

I do have a report which shows a a report using the following basic SQL

SELECT tbl_stock_level.Stock_id, tbl_stock_level.Description, tbl_stock_level.supplier_id, tbl_supplierdetails.supplier_name, tbl_supplierdetails.Supplier_telno1, tbl_supplierdetails.supplier_contactemail
FROM tbl_stock_level, tbl_supplierdetails
WHERE (((tbl_stock_level.Current_stock)<[Stock_level]*0.2));

But id like to have a message box to appear, which i understand how to do, but im not clear how to keep the check permenantly running in the background.


just a though............................................ .......when a front end selection is made (i.e. product is selected) and the stock used to create the product is reduced, could i just have a little check at the end of that piece of code?

Ive a feeling if just answered the question.

what do you think?

micksitup
05-09-2007, 04:48 AM
and another thing.

Im using access 07, and i wish to make the dbase standalone. I have used the "create mde" tool, but when i open it i can still do everything as if it were an mdb

boblarson
05-09-2007, 04:54 AM
and another thing.

Im using access 07, and i wish to make the dbase standalone. I have used the "create mde" tool, but when i open it i can still do everything as if it were an mdb

You aren't going to be able to make it a "standalone" program. When they come out with the A2K7 runtime then you can redistribute your database so people without Access can run it. For now, anyone who needs your program will need Access 2007 to run it (unless you use compatibility mode so users of previous versions can use it).

To use your accde file, change the extension to accdr and that will change it to the runtime version. But, it is easy for anyone to just change the name back and get full functionality back.

rainman89
05-09-2007, 05:12 AM
i think you could try in the after update of your form. but it might work better in another event. just not sure which one.

if((tbl_stock_level.Current_stock)<([Stock_level]*0.2)) Then
Msgbox "Stock Level is low please reorder"
else
end if

micksitup
05-10-2007, 02:30 AM
lol thats what came to mind when i was typing the last message and it worked so happy days.

With regards to 07, all i can say is grrrrrrrrrrrrrrrrrr to msoft!!!!