Advertisement
Advertisement
| 06.27.2008 at 11:56AM PDT, ID: 23522681 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: |
Private Sub cmdAddParts_Click()
'dimension all variables
Dim strSQL As String
'make sure the user entered BatchItemSKU and BatchToBuildQty first
If IsNull(Me!BatchItemSKU) Or IsNull(Me!BatchToBuildQty) Or Me.BatchToBuildQty.Value = 0 Then
MsgBox "Please select a B.O.M. SKU and an Expected Quantity first.", vbCritical, "Can't Add Parts"
Else
'Now build the SQL to insert the rows into tblBatchItems
strSQL = "INSERT INTO tblBatchParts ( BatchNumber, BatchPartSKU, PartQty, NetQty )"
strSQL = strSQL & " SELECT " & Me!BatchNumber & ", tblBOMParts.ItemNmbr, "
strSQL = strSQL & " tblBOMParts.ItemQty * " & Me!BatchToBuildQty
strSQL = strSQL & " tblBOMParts.ReplacePercentage +1 * " & Me!BatchToBuildQty
strSQL = strSQL & " FROM tblBOMParts WHERE BOMPartNum = '" & Me!BatchItemSKU & "';"
'turn off warnings so the user doesn't get a popup
DoCmd.SetWarnings False
'Execute the SQL code
DoCmd.RunSQL strSQL
'turn warnings back on
DoCmd.SetWarnings True
'Refresh the SubForm
Me!sfmBatchParts.Requery
End If
End Sub
|