If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
help with code builder
I have set up a button using the wizard which opens
another form and displays the related record. I want this button to also close the original form when it displays the related form. Where do I put the code and what do I say? the existing code produced by the wizard is as follows: Private Sub go_to_edit_worker_Click() On Error GoTo Err_go_to_edit_worker_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "new employee edit" stLinkCriteria = "[employee ID new]=" & Me![employee ID new] DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_go_to_edit_worker_Click: Exit Sub Err_go_to_edit_worker_Click: MsgBox Err.Description Resume Exit_go_to_edit_worker_Click End Sub I want to close the original form called 'worker details filter form' How do I go about this? regards |
#2
|
|||
|
|||
See VBA Help on the DoCmd object and its methods.
Insert the following line after the DoCmd.OpenForm statement: DoCmd.Close acForm, "Your Form Name" HTH Kevin Sprinkel -----Original Message----- I have set up a button using the wizard which opens another form and displays the related record. I want this button to also close the original form when it displays the related form. Where do I put the code and what do I say? the existing code produced by the wizard is as follows: Private Sub go_to_edit_worker_Click() On Error GoTo Err_go_to_edit_worker_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "new employee edit" stLinkCriteria = "[employee ID new]=" & Me![employee ID new] DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_go_to_edit_worker_Click: Exit Sub Err_go_to_edit_worker_Click: MsgBox Err.Description Resume Exit_go_to_edit_worker_Click End Sub I want to close the original form called 'worker details filter form' How do I go about this? regards . |
#3
|
|||
|
|||
On Wed, 22 Sep 2004 04:42:11 -0700, lynn atkinson wrote:
I have set up a button using the wizard which opens another form and displays the related record. I want this button to also close the original form when it displays the related form. Where do I put the code and what do I say? the existing code produced by the wizard is as follows: Private Sub go_to_edit_worker_Click() On Error GoTo Err_go_to_edit_worker_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "new employee edit" stLinkCriteria = "[employee ID new]=" & Me![employee ID new] DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_go_to_edit_worker_Click: Exit Sub Err_go_to_edit_worker_Click: MsgBox Err.Description Resume Exit_go_to_edit_worker_Click End Sub I want to close the original form called 'worker details filter form' How do I go about this? regards DoCmd.OpenForm stDocName, , , stLinkCriteria DoCmd.Close acForm, Me.Name -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Print a Tab instruction in "Code 3 of 9" bar code on an Access re. | Dwise | Setting Up & Running Reports | 1 | September 9th, 2004 07:23 PM |
How to phrase If/Then clauses in the control source field | Database Design | 13 | August 14th, 2004 04:22 PM | |
Form to generate a Report code | Pat Coleman | Setting Up & Running Reports | 4 | July 16th, 2004 12:58 PM |
Hide or show Control Button on Form in Access 97 | Pete Sperling | Using Forms | 8 | July 13th, 2004 04:13 PM |
customizing "documentor" output | W Garrard | Database Design | 12 | May 24th, 2004 03:07 AM |