ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Help!¼Æ¶q»P®w¦s¤§¶¡ªºÅçÃÒ°ÝÃD

[µo°Ý] Help!¼Æ¶q»P®w¦s¤§¶¡ªºÅçÃÒ°ÝÃD

§Ú¦³¤@­Óinput box ¨Ó¿é¤J¼Æ¶q
¦ý§Úªº¥N½X¥u¹ï¼Æ¶q©M®w¦sªº­­¨î¤£°_§@¥Î
¦pªG¼Æ¶q>®w¦s¼Æ¶q
input box·|¤@ª½´`Àô

¦pªG®w¦s¤ô¥­¬O200
§Ú¿é¤J50¡A¦ýinputÁÙ¬O´`Àô
§Ú¤£ª¾¹D§Úªº¥N½X°µ¿ù¤F¤°»ò
  1.   Do
  2.    Myquantity = InputBox("Please Specify the Quantity of ProductID." _
  3.                  & Me.ProductID & vbCr & "")
  4.                  
  5.    If (Myquantity <> "") Then Q = ValidateQ(Myquantity)
  6.             Loop While (Q = False) Or (Myquantity = "") Or (Myquantity = "0") Or (Myquantity > Me.Stock_level)

  7.    Forms![F_Orders].[F_Order_line_subform].SetFocus
  8.   DoCmd.GoToRecord , , acLast
  9.    Me.Parent.F_Order_line_subform.Form!Quantity = Myquantity
  10.    MsgBox "The order of ProductID." _
  11.                                 & Me.ProductID & vbCr & "successfully added to order"
½Æ»s¥N½X
  1. Function ValidateQ(Myquantity As String) As Boolean
  2.     Dim strLength As Integer
  3.     Dim I As Integer
  4.    
  5.     Myquantity = Trim(Myquantity)
  6.     strLength = Len(Myquantity)
  7. For I = 1 To strLength

  8. If Myquantity = "0" Then
  9. ValidateQ = False
  10. msb = MsgBox("Invalid values, this values is not allow to enter , try again", vbCritical, "Error")
  11. Else
  12.   ValidateQ = True

  13.        End If
  14.         
  15.     Next I
  16.     If (Myquantity <> "") Then
  17.     If IsNumeric(Myquantity) Then
  18.     ValidateQ = True
  19.     Else
  20.         ValidateQ = False
  21.         msb = MsgBox("invalid values,PLease enter a Numeric values ", vbCritical, "Error")
  22.    
  23.         
  24.   End If
  25.   End If
  26. End Function
½Æ»s¥N½X

        ÀR«ä¦Û¦b : §ïÅܦۤv¬O¦Û±Ï¡A¼vÅT§O¤H¬O±Ï¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD