Private Sub cmdUpdatePart_Click()
On Error GoTo Err_UpdatePart_Click
Dim db As Database
Dim updatePart As String
Dim part As String
Dim man As String
Dim des As String
Dim ce As String
Dim wj As String
Dim ss As String
Dim he As String
Dim pack As String
Set db = CurrentDb
If ([Forms]![frmMain]![subfrmProdSpecs].[Form]![txtPartNum] = Null) Then
MsgBox "You must enter a Part Number", vbOKOnly
ElseIf ([Forms]![frmMain]![subfrmProdSpecs].[Form]![txtDescription] = Null) Then
MsgBox "Please enter a Description of the part.", vbOKOnly
End If
part = [Forms]![frmMain]![subfrmProdSpecs].[Form]![txtPartNum]
man = [Forms]![frmMain]![subfrmProdSpecs].[Form]![txtManufacturer]
des = [Forms]![frmMain]![subfrmProdSpecs].[Form]![txtDescription]
ce = "I:\Product Specifications\Cold End\" & [Forms]![frmMain]![subfrmProdSpecs].[Form]![txtCE_Packet]
wj = "I:\Product Specifications\Water Jet\" & [Forms]![frmMain]![subfrmProdSpecs].[Form]![txtWJ_Packet]
ss = "I:\Product Specifications\Silk Screen\" & [Forms]![frmMain]![subfrmProdSpecs].[Form]![txtSS_Packet]
he = "I:\Product Specifications\Hot End\" & [Forms]![frmMain]![subfrmProdSpecs].[Form]![txtHE_Packet]
pack = "I:\Product Specifications\Packaging\" & [Forms]![frmMain]![subfrmProdSpecs].[Form]![txtPack_Packet]
updatePart = "INSERT INTO tblParts VALUES ('" & part & "', '" & man & "', '" & des & "', '" & ce & "', '" & wj & "', '" & ss & "', '" & he & "', '" & pack & "')"
DoCmd.RunSQL (updatePart)
Err_UpdatePart_Click:
If ([Forms]![frmMain]![subfrmProdSpecs].[Form]![txtPartNum] = Null) Then
MsgBox "You must enter a Part Number", vbOKOnly
ElseIf ([Forms]![frmMain]![subfrmProdSpecs].[Form]![txtDescription] = Null) Then
MsgBox "Please enter a Description of the part.", vbOKOnly
Else: MsgBox Err.Description
End If
Resume Exit_UpdatePart_Click
Exit_UpdatePart_Click:
Exit Sub
End Sub
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.