mdthornton
Programmer
I have a public sub ("compileReportData"
defined in one of my database modules. compileReportData does all of the applications core data manipulation and generates results for reports etc. I have a button on my switchboard which calls compileReportData and this works fine.
I'm trying now to develop a batch process which will run overnight so that users in London can receive a feed of the data without having to wait for us to get into the office.
I'm experimenting with starting the database up with a
command parameter, eg:
msaccess.exe mydb.mdb /command batch
and in the open event for the main form just do something like:
Private Sub Form_Open(Cancel As Integer)
InitDb
If Command() = "batch" Then
compileReportData
Application.Quit
End If
End Sub
This seems to be on the right lines and the first few lines of compileReportData execute but I get an "undefined function (nz) in expression" error when I try to execute a query which references the nz function. I've seen other threads in this forum where the solution is that the DAO library is not in the references table but this is not the
case here. I've tried moving the code above to different events eg onload, oncurrent but it makes no difference. Whats more curious is that if, when the error occurs, I halt the code, switch the form to design view and then reopen it everything works fine, ie compileReportData executes fully and the application exits.
I'm clutching at straws but is there a way to preload the referenced libraries? Anyone got any ideas or seen anything similar?
Thanks in advance,
Mike T
I'm trying now to develop a batch process which will run overnight so that users in London can receive a feed of the data without having to wait for us to get into the office.
I'm experimenting with starting the database up with a
command parameter, eg:
msaccess.exe mydb.mdb /command batch
and in the open event for the main form just do something like:
Private Sub Form_Open(Cancel As Integer)
InitDb
If Command() = "batch" Then
compileReportData
Application.Quit
End If
End Sub
This seems to be on the right lines and the first few lines of compileReportData execute but I get an "undefined function (nz) in expression" error when I try to execute a query which references the nz function. I've seen other threads in this forum where the solution is that the DAO library is not in the references table but this is not the
case here. I've tried moving the code above to different events eg onload, oncurrent but it makes no difference. Whats more curious is that if, when the error occurs, I halt the code, switch the form to design view and then reopen it everything works fine, ie compileReportData executes fully and the application exits.
I'm clutching at straws but is there a way to preload the referenced libraries? Anyone got any ideas or seen anything similar?
Thanks in advance,
Mike T