I got a code that uses many IF conditions. Here's the basic structure:
the problem I have is that when the stock is low (go to 3rd IF), it would open form FrmOrderUnit. But as soon as the form opened, the program continues to check the next item and would open the form again, thus give me error message:
runtime error 3211 : the database could not lock table "TblOrderUnit" because it is in use by another person or process
How do I set that if the form is opened, the process stops running until I have do something with that form?
THanks!
Code:
do while unitRS.EOF=false
IF Stock>Order THEN
'msgbox ("Stock is enough")
ELSEIF Stock=Order THEN
'msgbox ("Stock is enough, stock is now 0")
ELSEIF Stock<Order AND Stock>0 THEN
'msgbox ("Stock is not enough, order some?")
docmd.openform "FrmOrderUnit"
ELSEIF Stock=0 THEN
'msgbox ("Stock is 0, order some?")
docmd.openform "FrmOrderUnit"
END IF
unitRS.movenext
loop
the problem I have is that when the stock is low (go to 3rd IF), it would open form FrmOrderUnit. But as soon as the form opened, the program continues to check the next item and would open the form again, thus give me error message:
runtime error 3211 : the database could not lock table "TblOrderUnit" because it is in use by another person or process
How do I set that if the form is opened, the process stops running until I have do something with that form?
THanks!