Hey, I have a this simple procedure in my from module :
Private Function sngMattVol(PRDATE As String, Ctry As String, Prty As String) As Single
Dim rec As Recordset
Set rec = CurrentDb.OpenRecordset("Select Sum
(ImportDetails.F15) as SumVol from
ImportDetails Inner Join
ImportOrders on
ImportDetails.F5 = ImportOrders.F5
Where ImportOrders.Country ='"& Ctry & "'
and ImportOrders.Priority = '" & Prty & "'
and ImportOrders.Prdate = '" & PRDATE & "'"
sngMattVol = rec.Fields!SumVol
rec.Close
End Function
But, almost each time I open or close the form (a control is bound to that function) I get the following error :
MSACCESS caused an invalid page fault in
module MSACCESS.EXE at 0167:30045745.
Registers:
EAX=00000000 CS=0167 EIP=30045745 EFLGS=00010246
EBX=00000001 SS=016f ESP=0062fa8c EBP=0062fab4
ECX=c14ebbc0 DS=016f ESI=00000bd8 FS=0f67
EDX=00017ce4 ES=016f EDI=00000000 GS=2d7f
Bytes at CS:EIP:
8b 80 8c 00 00 00 c3 e8 08 e3 ff ff eb f2 53 55
Stack dump:
30084fb2 00000bd8 30086a3e 00000bd8 00000000 00b54734 30153f09 07d0feb4 65224a88 65224a98 0062fad4 650fa444 00b54734 00000002 65224a98 07d16cb4
What the hell can I do??
Private Function sngMattVol(PRDATE As String, Ctry As String, Prty As String) As Single
Dim rec As Recordset
Set rec = CurrentDb.OpenRecordset("Select Sum
(ImportDetails.F15) as SumVol from
ImportDetails Inner Join
ImportOrders on
ImportDetails.F5 = ImportOrders.F5
Where ImportOrders.Country ='"& Ctry & "'
and ImportOrders.Priority = '" & Prty & "'
and ImportOrders.Prdate = '" & PRDATE & "'"
sngMattVol = rec.Fields!SumVol
rec.Close
End Function
But, almost each time I open or close the form (a control is bound to that function) I get the following error :
MSACCESS caused an invalid page fault in
module MSACCESS.EXE at 0167:30045745.
Registers:
EAX=00000000 CS=0167 EIP=30045745 EFLGS=00010246
EBX=00000001 SS=016f ESP=0062fa8c EBP=0062fab4
ECX=c14ebbc0 DS=016f ESI=00000bd8 FS=0f67
EDX=00017ce4 ES=016f EDI=00000000 GS=2d7f
Bytes at CS:EIP:
8b 80 8c 00 00 00 c3 e8 08 e3 ff ff eb f2 53 55
Stack dump:
30084fb2 00000bd8 30086a3e 00000bd8 00000000 00b54734 30153f09 07d0feb4 65224a88 65224a98 0062fad4 650fa444 00b54734 00000002 65224a98 07d16cb4
What the hell can I do??