M
Melissa
HELP! I've been struggling for awhile on this and would appreciate any help.
I am trying to create a command button that once clicked will notify the
user via a message box that the order they placed did not meet certian
criteria.
Here's the code I came up with. What is wrong with it? It keeps looping,
but when I break it, VBA highlights the Case 1 to 4 line.
Do Until rstOrders.EOF
Select Case rstOrders.MOQ
Case 1 To 4
intDifference = rstOrders.Quantity Mod rstOrders.containersize
If Not intDifference = 0 Then
strMessage = strMessage & "Item #" & """ & rstOrders.ItemNumber & """ & _
" - ordered quantity of " & """ & rstorders.quantity & """ & " does not meet
" & _
""" & rstOrders.Containertype & """ & " of " & """ & rstOrders.containersize
& """ & _
Chr(13)
Else
End If
Case 5
If rstOrders.Quantity < rstOrders.containersize Then
strMessage = strMessage & "Item #" & """ & rstOrders.ItemNumber & """ & _
" - ordered quantity of " & """ & rstorders.quantity & """ & " does not meet
" & _
""" & rstOrders.Containertype & """ & " of " & """ & rstOrders.containersize
& """ & _
Chr(13)
End If
End Select
Loop
Thanks.
I am trying to create a command button that once clicked will notify the
user via a message box that the order they placed did not meet certian
criteria.
Here's the code I came up with. What is wrong with it? It keeps looping,
but when I break it, VBA highlights the Case 1 to 4 line.
Do Until rstOrders.EOF
Select Case rstOrders.MOQ
Case 1 To 4
intDifference = rstOrders.Quantity Mod rstOrders.containersize
If Not intDifference = 0 Then
strMessage = strMessage & "Item #" & """ & rstOrders.ItemNumber & """ & _
" - ordered quantity of " & """ & rstorders.quantity & """ & " does not meet
" & _
""" & rstOrders.Containertype & """ & " of " & """ & rstOrders.containersize
& """ & _
Chr(13)
Else
End If
Case 5
If rstOrders.Quantity < rstOrders.containersize Then
strMessage = strMessage & "Item #" & """ & rstOrders.ItemNumber & """ & _
" - ordered quantity of " & """ & rstorders.quantity & """ & " does not meet
" & _
""" & rstOrders.Containertype & """ & " of " & """ & rstOrders.containersize
& """ & _
Chr(13)
End If
End Select
Loop
Thanks.