Open form in a New Window using a command button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jmartmem
    New Member
    • Feb 2008
    • 87

    Open form in a New Window using a command button

    I have an Access 2002 main form ("Project Update Form") with a subform ("sfEZMilestone ").

    What I want is to somehow change the subform to a command button so when a user clicks the command button, it will open the subform in a new window (like a pop up window). There, the user can update and edit the fields as necessary then close the window and return to the main form.

    The Link Child Field is ID and the Link Master Field is ID.

    Regards,

    - JM
  • jeffstl
    Recognized Expert Contributor
    • Feb 2008
    • 432

    #2
    This is going to come down to handling your Form_Load() in each forms and Form_Unload to get the kind of navigation you want.

    The basics of this is below though, and I think there are even wizards that will generate this by placing a command button on a form, you can tell it that you want to perform Form Operations with that button.

    Code:
    Private Sub Command2_Click()
    On Error GoTo Err_Command2_Click
    
        Dim stDocName As String
        Dim stLinkCriteria As String
    
        stDocName = "Form1"
        DoCmd.OpenForm stDocName, , , stLinkCriteria
    
    Exit_Command2_Click:
        Exit Sub
    
    Err_Command2_Click:
        MsgBox Err.Description
        Resume Exit_Command2_Click
        
    End Sub

    Comment

    • louisjones
      New Member
      • Mar 2008
      • 5

      #3
      This is exactly whay I am trying to do without any luck! How did you get on?

      Cheers

      Comment

      Working...