Hello 
I'm trying to run my module, but half way into it a pop up comes up saying something along the lines of "MSACCESS.exe has generated errors. and error log is being created. windows will shut down access".
i tried using the exact same code on another (smaller) program and it worked perfectly. just wondering if anyboday can suggest anything, i'm really need help. thanks
End Sub

I'm trying to run my module, but half way into it a pop up comes up saying something along the lines of "MSACCESS.exe has generated errors. and error log is being created. windows will shut down access".
i tried using the exact same code on another (smaller) program and it worked perfectly. just wondering if anyboday can suggest anything, i'm really need help. thanks
Code:
Sub Create()
Dim OriginalRS As Recordset
Dim DataRS As Recordset
Dim CustCode, PremCode, Cust2Code, Prem2Code As Long
Dim found As Boolean
Dim NumRecords As Long
Dim aRecord As Long
Set OriginalRS = CurrentDb.OpenRecordset("Res_phone", dbOpenDynaset)
Set DataRS = CurrentDb.OpenRecordset("NotInCustListLess18000", dbOpenDynaset)
CustCode = DataRS!CustCode
PremCode = DataRS!PremCode
Cust2Code = OriginalRS!Cust_Code
Prem2Code = OriginalRS!Prem_Code
aRecord = 1
OriginalRS.MoveLast
NumRecords = OriginalRS.RecordCount
OriginalRS.MoveFirst
found = False
Do Until DataRS.EOF
Do Until found = True Or OriginalRS.EOF
CustCode = DataRS!CustCode.Value
PremCode = DataRS!PremCode.Value
Cust2Code = OriginalRS!Cust_Code.Value
Prem2Code = OriginalRS!Prem_Code.Value
If CustCode = Cust2Code And PremCode = Prem2Code Then
found = True
Exit Do
Else
If aRecord < NumRecords Then
aRecord = aRecord + 1
OriginalRS.MoveNext
Else
aRecord = 0
Exit Do
End If
End If
Loop
If found = True Then
DataRS.Edit
DataRS!PhoneNumber = OriginalRS!PhoneNumber
DataRS!AreaCode = OriginalRS!AreaCode
DataRS!Extention = OriginalRS!Extention
DataRS.Update
End If
DataRS.MoveNext
aRecord = 1
OriginalRS.MoveFirst
found = False
Loop
DataRS.Close
Set DataRS = Nothing
OriginalRS.Close
Set OriginalRS = Nothing