Need more help on Message box PLEASE

  • Thread starter Thread starter Kathy
  • Start date Start date
K

Kathy

Hi. I got help writing the following code but it is not
working--need msgbox to pop up as soon as "QtyOnHand"
drops below 5. "QtyOnHand" is in a subform. I have tried
the event procedure below in both the form and
subform..the message only pops up the next ime you access
a record that has qty less than 5.

Sub Form_Currant()
If Me.QtyOnHand <5 Then
MsgBox "Inventory is less than 5", vbOKOnly,
"Low Inventory"
End If
End Sub
 
You need the same code, preceded by Me.Refresh, in the AfterUpdate
Event of any user-editable Control that modifies QtyOnHand (which I
assume is an unbound, calculated, control).

If addition, if you are addressing a control in a subform from the
main form, you need to say something like:
Me.MySubformControl!QtyOnHand

Hi. I got help writing the following code but it is not
working--need msgbox to pop up as soon as "QtyOnHand"
drops below 5. "QtyOnHand" is in a subform. I have tried
the event procedure below in both the form and
subform..the message only pops up the next ime you access
a record that has qty less than 5.

Sub Form_Currant()
If Me.QtyOnHand <5 Then
MsgBox "Inventory is less than 5", vbOKOnly,
"Low Inventory"
End If
End Sub


Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
Thank You Al that worked.
-----Original Message-----
Try the AfterUpdate event of the subform.

--

Alphonse Giambrone
Email: a-giam at customdatasolutions dot us





.
 
Back
Top