2017-09-22 8 views

답변

1

"새"양식을 열 때 매개 변수로 ID를 전달할 수 있습니다. 당신의 버튼의 Click 이벤트에

: 폼의 Load 이벤트에

Private Sub Command0_Click() 
    'Get the ID 
    Dim id_ As Long 
     id_ = Me.SubformName.Form!ID 

    'Open the new form and pass the ID to the .OpenArgs 
    DoCmd.OpenForm "FormName", acNormal, , , acFormPropertySettings, acWindowNormal, id_ 
End Sub 

는 .OpenArgs을 확인하고 필터링 할 양식을 (또는 당신이해야 할 어떤 다른) 제공된 ID에.

Private Sub Form_Load() 
    With Me 
     If Not IsNull(.OpenArgs) Then 
      .Filter = "[ID]=" & .OpenArgs 
      .FilterOn = True 
      .Caption = "ID: " & .OpenArgs 
     End If 
    End With 
End Sub