Advertisement
Advertisement
| 08.28.2008 at 12:44PM PDT, ID: 23686932 |
|
[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: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: |
Option Compare Database
Private Sub cmdSend_Click()
Dim rs As DAO.Recordset
Dim rs1 As DAO.Recordset
Dim strMax As String
Dim strSO As String
Dim strSQL As String
Dim strSOList As String
Set rs1 = CurrentDb.OpenRecordset("SELECT PrinterID, ServiceTech, Electronic, InterimSONum FROM tblRMASOExtras WHERE InterimSONum = " & Me!InterimSONum)
If IsNull(rs1!PrinterID) Or IsNull(rs1!ServiceTech) Or IsNull(rs1!Electronic) Then
MsgBox "Please make sure the Service Tech, PrinterID, and Method of Communication fields are entered in the RMA Extras tab.", vbCritical, "Can't send data to SW"
Else
strSOList = "The following Sales Orders were created in Service Works:" & vbCrLf & vbCrLf
If IsNull(Me!txtLocationNmbr) Or IsNull(Me!cboRequestBy) Or IsNull(Me!cboSalesRep) Or IsNull(Me!txtRMANumber) Or (Me!txtRMANumber = 0) Then
MsgBox "Please make sure the REQUEST BY, SALES REP, and LOCATION NUMBER fields are filled in.", vbCritical, "Can't send data to SW"
Else
rs1.Close
End If
Set rs = CurrentDb.OpenRecordset("SELECT InterimSONum, SalesOrderNmbr FROM tblRMA WHERE Status = 'HOLD';")
strMax = DMax("SalesOrderNmbr", "SalesOrder", "LEFT(SalesOrderNmbr, 1) = 'S'")
iMax = Val(Mid(strMax, 2))
Do Until rs.EOF
iMax = iMax + 1
strSO = "S" & Right("00000" & iMax, 5)
rs.Edit
rs!SalesOrderNmbr = strSO
rs.Update
strSQL = "UPDATE tblRMAItem SET SalesOrderNmbr = '" & strSO & "' WHERE InterimSONum = " & rs!InterimSONum & ";"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
strSOList = strSOList & " " & strSO & vbCrLf
rs.MoveNext
Loop
rs.Close
DoCmd.SetWarnings False
DoCmd.OpenQuery "qapCreateRMASOToSW"
DoCmd.OpenQuery "qapCreateRMASOItemToSW"
DoCmd.OpenQuery "qupSetSOsToSent"
DoCmd.OpenQuery "qupSetSOsToCancelled"
DoCmd.SetWarnings False
MsgBox strSOList, vbInformation, "Success"
Dim strMaxSO As String
Dim iMaxSO As String
strMaxSO = DMax("SalesOrderNmbr", "SalesOrder", "LEFT(SalesOrderNmbr, 1) = 'S'")
iMaxSO = Val(Mid(strMaxSO, 2))
iMaxSO = iMaxSO + 1
strMaxSO = "S" & Right("00000" & iMaxSO, 5)
strSQL = "UPDATE Company SET SalesOrderNmbr = '" & strMaxSO & "';"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.Close acForm, Me.Name
End If
End Sub
|