- ©«¤l
- 8
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 11
- ÂI¦W
- 0
- §@·~¨t²Î
- Window 8
- ³nÅ骩¥»
- OFFICE 2007
- ¾\ŪÅv
- 10
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2014-11-7
- ³Ì«áµn¿ý
- 2015-3-11
|
[µ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¤°»ò- Do
- Myquantity = InputBox("Please Specify the Quantity of ProductID." _
- & Me.ProductID & vbCr & "")
-
- If (Myquantity <> "") Then Q = ValidateQ(Myquantity)
- Loop While (Q = False) Or (Myquantity = "") Or (Myquantity = "0") Or (Myquantity > Me.Stock_level)
- Forms![F_Orders].[F_Order_line_subform].SetFocus
- DoCmd.GoToRecord , , acLast
- Me.Parent.F_Order_line_subform.Form!Quantity = Myquantity
- MsgBox "The order of ProductID." _
- & Me.ProductID & vbCr & "successfully added to order"
½Æ»s¥N½X- Function ValidateQ(Myquantity As String) As Boolean
- Dim strLength As Integer
- Dim I As Integer
-
- Myquantity = Trim(Myquantity)
- strLength = Len(Myquantity)
- For I = 1 To strLength
- If Myquantity = "0" Then
- ValidateQ = False
- msb = MsgBox("Invalid values, this values is not allow to enter , try again", vbCritical, "Error")
- Else
- ValidateQ = True
-
- End If
-
- Next I
- If (Myquantity <> "") Then
- If IsNumeric(Myquantity) Then
- ValidateQ = True
- Else
- ValidateQ = False
- msb = MsgBox("invalid values,PLease enter a Numeric values ", vbCritical, "Error")
-
-
- End If
- End If
- End Function
½Æ»s¥N½X |
|