On Oct 28, 9:47 am, "Dirk Goldgar"
<d... DeleteThis @NOdataSPAMgnostics.com.invalid> wrote:
> A class module has to be instantiated before you can call any of its
> methods. For example,
>
> Set o = New clsMyClass : o.Test
>
> --
> Dirk Goldgar, MS Access MVP
> Access tips:www.datagnostics.com/tips.html
>
> (please reply to the newsgroup)
>
> "alex" <sql_... DeleteThis @yahoo.com> wrote in message
>
> news:2ce44c5d-551a-45ae-835c-03e09a3c197b@s15g2000yqs.googlegroups.com...
> Immediate Window?
>
> Hello,
>
> Using Access ’03…
>
> I’m sure this must be an easy question, but I’m a bit confused.
>
> Why can I run this function in the Immediate Window of a global module
> but not in a Class Module.
>
> Function Test()
>
> 'Dim db As Database
> Dim sql As String
> 'Set db = CurrentDb()
>
> sql = "select * from table"
> Debug.Print sql
> 'Set ds = db.CreateDynaset(sql)
>
> End Function
>
> In a Global Module - ?Test() will return the sql string.
> In a Class Module - ?Test() will return the error: Sub or Function
> not defined.
>
> Thanks,
> alex
Thanks Dirk; I think I understand that!
alex