By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,707 Members | 1,640 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,707 IT Pros & Developers. It's quick & easy.

Open form in a New Window using a command button

P: 87
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.


- JM
Feb 27 '08 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 432
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.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command2_Click()
  2. On Error GoTo Err_Command2_Click
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  7.     stDocName = "Form1"
  8.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  10. Exit_Command2_Click:
  11.     Exit Sub
  13. Err_Command2_Click:
  14.     MsgBox Err.Description
  15.     Resume Exit_Command2_Click
  17. End Sub
Feb 27 '08 #2

P: 5
This is exactly whay I am trying to do without any luck! How did you get on?

Mar 25 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.