N
Nick T
Hi,
I have a cmd button for which i have the following code behind. Im using
this button to open a form, however, when this button is clicked, i want the
form on which this button is located to close. Where in my code could i put
a DoCmd.close function, or somthing simular to carry out the same function?
In summary, in one click, i want to open one form & close another(?)
My code behind my Cmd button is:
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form1"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms.Form1.FillLocation = Forms.Form2.FillLocation
Forms.Forms1.ProductDescription = Forms.Form2.ProductDescription
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub
This code is behind my cmd button "Command2". It carrys out its function
well, however i also want it to close the form that "Command2" is on when it
is clicked.
I hope iv not confused my explanation, however any help appreciated.
Many thanks
I have a cmd button for which i have the following code behind. Im using
this button to open a form, however, when this button is clicked, i want the
form on which this button is located to close. Where in my code could i put
a DoCmd.close function, or somthing simular to carry out the same function?
In summary, in one click, i want to open one form & close another(?)
My code behind my Cmd button is:
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form1"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms.Form1.FillLocation = Forms.Form2.FillLocation
Forms.Forms1.ProductDescription = Forms.Form2.ProductDescription
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub
This code is behind my cmd button "Command2". It carrys out its function
well, however i also want it to close the form that "Command2" is on when it
is clicked.
I hope iv not confused my explanation, however any help appreciated.
Many thanks