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")
    MsgBox "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




Reply via email to