Results 1 to 2 of 2

Thread: [RESOLVED] linking a report with a form

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2018
    Posts
    54

    Resolved [RESOLVED] linking a report with a form

    i need to link the planning worksheet to auto fill from the order master. right now i have user typing in order number but would like to somehow link the me.[order number] from the form to the report
    Code:
    Private Sub Planning_Work_Sheet_Click()
    On Error GoTo Err_Planning_Work_Sheet_Click
    
        Dim stDocName As String
    
        stDocName = "Planning Work Sheet"
        DoCmd.OpenReport stDocName, acPreview
    
    Exit_Planning_Work_Sheet_Click:
        Exit Sub
    
    Err_Planning_Work_Sheet_Click:
        MsgBox Err.Description
        Resume Exit_Planning_Work_Sheet_Click
        
    End Sub
    Name:  hhhh.jpg
Views: 208
Size:  26.4 KB

  2. #2

    Thread Starter
    Member
    Join Date
    Feb 2018
    Posts
    54

    Re: linking a report with a form

    i used this code to move the record to a different table then made the report off that table,
    Code:
    Private Sub Command985_Click()
    On Error GoTo Err_Command985_Click
    DoCmd.SetWarnings False
    DoCmd.RunSQL "Delete * From pwstbl"
        Dim onn As String
        Dim stDocName As String
        
        onn = [order number].Value
        DoCmd.RunSQL "insert into pwstbl select * from [Order Master] where [Order Number] = '" & onn & "'"
    
        stDocName = "pws"
        DoCmd.OpenReport stDocName, acPreview
    
    Exit_Command985_Click:
        Exit Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width