Title: Message
"and set TimerInterval back to 0 so it would re-run the code every 1/2 second"
 
Oops, I meant to say that I set TimerInterval back to 0 so it WOULDN'T re-run every 1/2 second.
 
Thanks,
Toby
----- Original Message -----
Sent: Wednesday, January 18, 2006 5:48 AM
Subject: RE: [AccessDevelopers] Re: Error running query with function automatically

But  - - - setting TimerInterval to 0 turns off the timer altogether!
 
Tobi
-----Original Message-----
From: AccessDevelopers@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Duane Hennessy
Sent: Wednesday, January 18, 2006 3:14 AM
To: AccessDevelopers@yahoogroups.com
Subject: [AccessDevelopers] Re: Error running query with function automatically

Classic! I love the way you explain the work-around because it sums up a lot of what we, as developers, have to do with Access, especially when asking it to do the mundane. I've added another verse to it, what  do you think...

I set TimerInterval = 500 and then called the Sub that opens the query that uses the module function from the Timer event, that tossed the dog, that worried the cat, that killed the rat, that ate the malt, that lay in the house that Jack built!

Good onya Toby you made my day.

Duane Hennessy
Senior Software Engineer and Systems Architect.
Bandicoot Software
Tropical Queensland, Australia
Ph. 00617-3398-6131
(ABN: 33 682 969 957)

Bandicoot CodeClipper, your code snippet organiser.
http://www.bandicootsoftware.com.au

--- In AccessDevelopers@yahoogroups.com, "Toby Bierly" <[EMAIL PROTECTED]> wrote:
>
> I was calling the Sub from the Open event. Still haven't figured out what the substantive difference is between Load and Open, but I tried calling from the Load event, with no luck.
>
> I also took a look at the References. Visual Basic for Applications and Microsoft Access 8.0 Object Library were the top two and were immovable. DAO library was 3rd above a couple others that were checked. So I couldn't move the DAO library up. I tried unchecking and then rechecking, again no luck.
>
> However, I did finally find a workaround.
>
> The best I can figure is that Access 97 does not make Module functions available to be run from DAO queries by the time the startup form's Load event is ran. As I said before, I got the error when running code using the starup form, but as soon as the database was open, I could run the same code that opened a query that used a function just fine.
>
> To work around this apparent bug or limitation, I used the Timer event. In my Load event, I set TimerInterval = 500 and then called the Sub that opens the query that uses the module function from the Timer event (and set TimerInterval back to 0 so it would re-run the code every 1/2 second). Everything is golden now.
>
> Thanks,
> Toby
> ----- Original Message -----
> From: Duane Hennessy
> To: AccessDevelopers@yahoogroups.com
> Sent: Tuesday, January 17, 2006 2:40 PM
> Subject: [AccessDevelopers] Re: Error running query with function automatically
>
>
> Toby,
> Are you calling the function from the Open event or the Load event of your form? If you are running from the Open event I suggest trying the Load event.
>
> You might want to take a look in your References under Tools|References in your code module. Sometimes the order in which different libraries load can cause this problem. Ensure that your DAO or ADO library are higher than the rest (except Visual Basic For Applications that is). Basically, find the library, select it and use the upward arrow button on the right of the dialog to take it as high as it will go. If another library is loading first then your DAO/ADO information will not be loaded properly when the form calls the function.
>
> Hope that helps.
>
> Bueno!
>
> Duane Hennessy.
> Bandicoot Software
> Tropical Queensland, Australia
> (ABN: 33 682 969 957)
>
> Why recode the wheel?
> http://www.bandicootsoftware.com.au
> --- In AccessDevelopers@yahoogroups.com, "Toby Bierly" [EMAIL PROTECTED] wrote:
> >
> > Can anyone explain to me why I get an error trying to open a select query into a recordset in code automatically run upon startup of the database when the select query and the code that opens the select query works just fine once the database is open?!
> >
> > I'm really getting frustrated with this one.
> >
> > I have a startup form that calls a Sub procedure. I have narrowed the Sub down to the following:
> >
> > Sub testrst()
> > Dim rst As Recordset
> ! > Set rst = CurrentDb.OpenRecordset("qry_UnaddedJobs")
> > MsgB ox "done"
> > End Sub
> >
> > If I open the database, qry_UnaddedJobs works just fine and the testrst Sub runs just fine. But when I call testrst from the startup form, I get the following error:
> >
> > Run-time error '3085':
> > Undefined function 'yy_year' in _expression_.
> >
> > Now 'yy_year' in one of a couple functions defined in a Module that the query uses. If I edit the query not to call yy_year, then the same error occurs on the other function that that query uses.
> >
> > Again, I know the functions work fine because the query uses them just fine once the database is open!
> >
> > Am I losing my mind??
> >
> > Any help will be appreciated.
> >
> > Thanks,
> > Toby
> >
>
>
>
>
>
> Please zip all files prior to uploading to Files section.
>
>
>
> ------------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
> a.. Visit your group "AccessDevelopers" on the web.
>
> b.. To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
> ------------------------------------------------------------------------------
>
>
>
> ------------------------------------------------------------------------------
>
> Spam
> Not spam
> Forget previous vote
>



Please zip all files prior to uploading to Files section.




YAHOO! GROUPS LINKS




Reply via email to