Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple procedure causes BIG error. Please HELP!

Status
Not open for further replies.

ak48

Technical User
Aug 1, 2003
34
US
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??
 
Besides praying instead of cursing?

The posted code is certainly NOT a real copy of what ever, as it would note numerous syntax essord througout. I might assume that you did the line break / wrap as a convenience to 'the rest of us'. However I will forego that and let you explain why the pretty print version is posted instead of the actual, as I, at least, see no obvious reason for the type of err you say happens 'almost' every time (assuming the "real" code includes the correct multi-line statement continuation character, or that YOU have correctly translated the single line into pretty print.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top