Can't find a form....

  • Thread starter Thread starter DLT
  • Start date Start date
D

DLT

Ok, stupid question here...
I am trying to access a form's code (specifically, the
load event) from a module. The problem is the form is
not open, so the debugger keeps telling me it can't find
the form I am looking for. I know I am doing something
dumb. Can someone help? - DLT
 
You could try this before your code in the module...

Echo 0
frmOpen("frmName")

' assumes you have a procedure called "frmOpen" that opens
the form identified by the string "frmName".

Here's that code if you need it...

====
Function frmOpen(frmName As String)
On Error GoTo Err_frmOpen

DoCmd.OpenForm frmName, acNormal

Exit_frmOpen:
Exit Function

Err_frmOpen:
MsgBox Err.Description
Resume Exit_frmOpen

End Function
====
 
Back
Top