Setting an object to existing form generates 'can't find form' error

Setting an object to existing form generates 'can't find form' error

Post by seamusmclu » Thu, 17 Jun 2004 04:37:28


Hi

I am attempting to set global variable (bad practice, will replace
with class later, just exploring an idea) with the following code in
an startup module

from globaldec.bas...

Global gfrmClient As Form
Global gstrClientForm As String


from startup.bas..

gstrClientForm = "frmClients"
Set gfrmClient = Forms(gstrClientForm)

At runtime I get 'MSA can't find form "frmClients"'

Thanks in advance

S
 
 
 

Setting an object to existing form generates 'can't find form' error

Post by MacDermot » Thu, 17 Jun 2004 09:50:12

Is the form open at the time?
If not, it's not a member of the Forms collection.

HTH
- Turtle