Am trying to figure out how to pass objects to functions and not sure that I understand it. Have a program that I want to check if the form is open before it attempts to open the target form. Copied the IsLoaded from the Northwind database. Left all the text the same. In the activating procedure, I declared a memory variable with the name of strFormName (which is the same as in the IsLoaded public function) and set the value to my form name(frmAddNew). Am getting a message that says this is a data type mismatch.
Here is my current code on the activation:Private Sub cmdAddNew_Click()
On Err GoTo Err_cmdAddNew_Click
Dim strFormName As String
strFormName = Forms!frmAddNew
If IsLoaded(strFormName) Then
MsgBox "Please try later when not in use!", vbOKOnly, "Already in use"
DoCmd.OpenForm "frmAddNew", acNormal
Select Case Err.Number
' MsgBox Err.Description
Follow-up question is that I can find no information in the VB Language Reference. Does this indicate that this function will not be operable in the near future? Should I discontinue using this?
Thanks, again, for your expert guidance.