darkstar257
Registered User.
- Local time
- Yesterday, 22:57
- Joined
- Jan 6, 2011
- Messages
- 77
I have a shipping form where the user fills out To, From, Address, Tracking #'s, etc. and in it is a sub form that contains a table of all the items ordered and shipped
I'm trying to do a message box that pops up if not all items are shipped. ie. items shipped < items ordered
Item_Line_sub is the sub form
This code runs when I press the close order button in the main form.
However, the problem is Me.Form![Item_Line_sub]![...] only calls up the current line item that my mouse cursor is on. If there are 3 items being shipped, it will only run the IF statement on the table item my cursor is sitting. So if my cursor marked sub form item fulfills the IF statement even if 2 out of 3 items don't, the warning message won't show up.
How would I be able to use the IF statement to compare every line item on the sub form's table?
I saw this web page in another thread: http://www.mvps.org/access/forms/frm0031.htm
But i don't know which my case would apply to.
I'm trying to do a message box that pops up if not all items are shipped. ie. items shipped < items ordered
Item_Line_sub is the sub form
This code runs when I press the close order button in the main form.
Code:
If (Me.Form![Item_Line_sub]![Qty Shipped] < Me.Form![Item_Line_sub]![Qty Ordered]) Or (IsNull(Me.Form![Item_Line_sub]![Qty Shipped]) Or Me.Form![Item_Line_sub]![Qty Shipped] = 0) Then
MsgBox ("Warning: All units have not been shipped.")
Else
'Ask for Close order confirmation
intResult = MsgBox("Are you sure you want to close order?", vbYesNo)
How would I be able to use the IF statement to compare every line item on the sub form's table?
I saw this web page in another thread: http://www.mvps.org/access/forms/frm0031.htm
But i don't know which my case would apply to.