Private Sub cmdCESpec_Click() On Error GoTo Err_cmdCESpec_Click Dim db As Database Dim rs As Recordset Dim s As String Dim specSheet As String s = "SELECT tblParts.PartNum, tblParts.CE_SpecSheet FROM tblParts WHERE (((tblParts.PartNum)=[Forms]![frmSpecSheet]![cboPartNum]));" 'Chooses the Correct Spec Sheet Set db = CurrentDb Set rs = db.OpenRecordset(s) specSheet = rs.Fields("CE_SpecSheet") 'Chooses the Spec Sheet Field rs.Close Dim oApp As Object Set oApp = CreateObject("Word.Application") oApp.Visible = True With oApp .Documents.Open ("specSheet") End With Exit_cmdCESpec_Click: Exit Sub Err_cmdCESpec_Click: MsgBox Err.Description Resume Exit_cmdCESpec_Click 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.