hi
i am having a little trouble getting my VBA code to work for closing a form.
I have create a form, and a command button called "Close". here's the simple code,
Code:
Sub cmdClose_Click()
globalFormName = Me.Name
Call myCloseForm(globalFormName)
End Sub
in VB editor, I created a Module1, and included a subroutine like this:
Code:
Public globalFormName As String
Public Sub myCloseForm(ByVal strName As String)
DoCmd.Close acForm, strName
End Sub
Then I try to view the form in Form view and click the button. But nothing happens. What could be the problem?
thanks