What is error number 3000?

S

SuzyQ

I'm getting this error when I try to test code from my mdb file. The mde
doesn't report an error, and prior to creating the mde, the mdb was not
reporting an error here. Is it somehow related to that or is it something
else. The error occurs when I run code that attempts to open a report. The
report has an on open procedure that writes data into a table that is the
recordsource for the report.
 
S

SuzyQ

It occurs at

DoCmd.RunSQL (strSQL) 'write previous record and continue statement when

strsql = "INSERT INTO tblScheduleBar (DistrictID, Category,
ActivityShortDesc, Comments, Week1, Week2 , Week3, Week4, Week5, Week6,
Week7, Week8, Week9, Week10, Week11, Week12, Week13, Week14, Week15, Week16,
Week17, Week18, Week19, Week20, Week21, Week22, Week23, Week24, p1, p2, p3,
p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19,
p20, p21, p22, p23, p24, RunTime) VALUES (' ', 'Awarded Grants/CoOps',
'9-Mile Paving (LHTAC)', ' ', False, False, False, False, False, False,
False, True, True, True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, #7/20/2009 12:19:02 PM#)"

it occurs at the first iteration of this line of code. Previously this code
was working just fine. All I did was create an MDE file after adding error
routines to all the procedures. Previously I was not using MDEs. The users
each just used a front-end mdb. The mde works through this code without a
problem, but my mdb stops at this point. Don't know if it is somehow
expecting to run off an mde and when it detects mdb it doesn't like it (Not
likely, because other reports run fine, but no other reports create their own
record source data on the fly)


Report_Open code...
Private Sub Report_Open(Cancel As Integer)
'On Error GoTo ErrorRoutine

Dim dteSunday As Date
Dim strSQL As String
Dim rs As DAO.Recordset
Dim booWeek1 As Boolean
Dim booWeek2 As Boolean
Dim booWeek3 As Boolean
Dim booWeek4 As Boolean
Dim booWeek5 As Boolean
Dim booWeek6 As Boolean
Dim booWeek7 As Boolean
Dim booWeek8 As Boolean
Dim booWeek9 As Boolean
Dim booWeek10 As Boolean
Dim booWeek11 As Boolean
Dim booWeek12 As Boolean
Dim booWeek13 As Boolean
Dim booWeek14 As Boolean
Dim booWeek15 As Boolean
Dim booWeek16 As Boolean
Dim booWeek17 As Boolean
Dim booWeek18 As Boolean
Dim booWeek19 As Boolean
Dim booWeek20 As Boolean
Dim booWeek21 As Boolean
Dim booWeek22 As Boolean
Dim booWeek23 As Boolean
Dim booWeek24 As Boolean
Dim strDistrict As String
Dim strCategory As String
Dim strActivity As String
Dim intPhase1 As Long
Dim intPhase2 As Long
Dim intPhase3 As Long
Dim intPhase4 As Long
Dim intPhase5 As Long
Dim intPhase6 As Long
Dim intPhase7 As Long
Dim intPhase8 As Long
Dim intPhase9 As Long
Dim intPhase10 As Long
Dim intPhase11 As Long
Dim intPhase12 As Long
Dim intPhase13 As Long
Dim intPhase14 As Long
Dim intPhase15 As Long
Dim intPhase16 As Long
Dim intPhase17 As Long
Dim intPhase18 As Long
Dim intPhase19 As Long
Dim intPhase20 As Long
Dim intPhase21 As Long
Dim intPhase22 As Long
Dim intPhase23 As Long
Dim intPhase24 As Long
Dim strComments As String

dteFreezeTime = Now()

'set up the weeks (Sunday date for the 16 consecutive weeks starting
with the Sunday date for date entered on frmReports
dteSunday = SundayDate([Forms]![frmReports]![txtFromDate])
dteWeek1 = dteSunday 'first week
dteWeek2 = dteSunday + 7 '1 week later (7 * 1)
dteWeek3 = dteSunday + 14 '2 weeks later (7 * 2)
dteWeek4 = dteSunday + 21 '3 weeks later (7 * 3)
dteWeek5 = dteSunday + 28 '4 weeks later (7 * 4)
dteWeek6 = dteSunday + 35 '5 weeks later (7 * 5)
dteWeek7 = dteSunday + 42 '6 weeks later (7 * 6)
dteWeek8 = dteSunday + 49 '7 weeks later (7 * 7)
dteWeek9 = dteSunday + 56 '8 weeks later (7 * 8)
dteWeek10 = dteSunday + 63 '9 weeks later (7 * 9)
dteWeek11 = dteSunday + 70 '10 weeks later (7 * 10)
dteWeek12 = dteSunday + 77 '11 weeks later (7 * 11)
dteWeek13 = dteSunday + 84 '12 weeks later (7 * 12)
dteWeek14 = dteSunday + 91 '13 weeks later (7 * 13)
dteWeek15 = dteSunday + 98 '14 weeks later (7 * 14)
dteWeek16 = dteSunday + 105 '15 weeks later (7 * 15)
dteWeek17 = dteSunday + 105 '16 weeks later (7 * 16)
dteWeek18 = dteSunday + 112 '17 weeks later (7 * 17)
dteWeek19 = dteSunday + 119 '18 weeks later (7 * 18)
dteWeek20 = dteSunday + 126 '19 weeks later (7 * 19)
dteWeek21 = dteSunday + 133 '20 weeks later (7 * 20)
dteWeek22 = dteSunday + 140 '21 weeks later (7 * 21)
dteWeek23 = dteSunday + 147 '22 weeks later (7 * 22)
dteWeek24 = dteSunday + 154 '23 weeks later (7 * 23) - 24th week

strSQL = "SELECT tblActivitiesForSchedule.DistrictID, tblGroup.Category,
tblActivitiesForSchedule.ActivityDescription, "
strSQL = strSQL & "tblActivitiesForSchedule.ActivityShortDesc,
SundayDate([StartDate]) AS sDate, "
strSQL = strSQL & "SaturdayDate([EndDate]) AS eDate, Phase "

strSQL = strSQL & "FROM (tblActivitiesForSchedule INNER JOIN tblGroup ON "
strSQL = strSQL & "tblActivitiesForSchedule.CategoryID =
tblGroup.CategoryID) "
strSQL = strSQL & "INNER JOIN tblProjectSchedule ON "
strSQL = strSQL & "tblActivitiesForSchedule.ActivityID =
tblProjectSchedule.ActivityID "

strSQL = strSQL & "WHERE "
strSQL = strSQL & "(((SundayDate([StartDate])) Between sundaydate(#" &
[Forms]![frmReports]![txtFromDate] & "#) And "
strSQL = strSQL & "sundaydate(# " & [Forms]![frmReports]![txtFromDate] &
"#)+(24*7))) OR "
strSQL = strSQL & "(((SaturdayDate([EndDate])) Between sundaydate(#" &
[Forms]![frmReports]![txtFromDate] & "#) And "
strSQL = strSQL & "sundaydate(#" & [Forms]![frmReports]![txtFromDate] &
"#)+(24*7))) OR "
strSQL = strSQL & "(((#" & [Forms]![frmReports]![txtFromDate] & "#)
Between [startDate] And [endDate])) "
strSQL = strSQL & "ORDER BY tblActivitiesForSchedule.ActivityShortDesc,
SundayDate([StartDate]) "

Set rs = CurrentDb.OpenRecordset(strSQL)

'initialize booleans
booWeek1 = False
booWeek2 = False
booWeek3 = False
booWeek4 = False
booWeek5 = False
booWeek6 = False
booWeek7 = False
booWeek8 = False
booWeek9 = False
booWeek10 = False
booWeek11 = False
booWeek12 = False
booWeek13 = False
booWeek14 = False
booWeek15 = False
booWeek16 = False
booWeek17 = False
booWeek18 = False
booWeek19 = False
booWeek20 = False
booWeek21 = False
booWeek22 = False
booWeek23 = False
booWeek24 = False
intPhase1 = 2
intPhase2 = 2
intPhase3 = 2
intPhase4 = 2
intPhase5 = 2
intPhase6 = 2
intPhase7 = 2
intPhase8 = 2
intPhase9 = 2
intPhase10 = 2
intPhase11 = 2
intPhase12 = 2
intPhase13 = 2
intPhase14 = 2
intPhase15 = 2
intPhase16 = 2
intPhase17 = 2
intPhase18 = 2
intPhase19 = 2
intPhase20 = 2
intPhase21 = 2
intPhase22 = 2
intPhase23 = 2
intPhase24 = 2

If Not rs.EOF Then
strDistrict = Nz(rs!DistrictID, " ")
strCategory = Nz(rs!Category, " ")
strActivity = Nz(rs!ActivityShortDesc, " ")
strComments = Nz(rs!ActivityDescription, " ")
Do While Not rs.EOF
If (strDistrict = rs!DistrictID Or (strDistrict = " " And
IsNull(rs!DistrictID))) And _
(strCategory = rs!Category Or (strCategory = " " And
IsNull(rs!Category))) And _
(strActivity = rs!ActivityShortDesc Or (strActivity = " "
And IsNull(rs!ActivityShortDesc))) Then

'Week 1 check
If dteWeek1 >= rs!sDate And dteWeek1 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek1 = True
intPhase1 = rs!Phase
End If

'Week 2 check
If dteWeek2 >= rs!sDate And dteWeek2 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek2 = True
intPhase2 = rs!Phase
End If

'Week 3 check
If dteWeek3 >= rs!sDate And dteWeek3 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek3 = True
intPhase3 = rs!Phase
End If

'Week 4 check
If dteWeek4 >= rs!sDate And dteWeek4 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek4 = True
intPhase4 = rs!Phase
End If

'Week 5 check
If dteWeek5 >= rs!sDate And dteWeek5 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek5 = True
intPhase5 = rs!Phase
End If

'Week 6 check
If dteWeek6 >= rs!sDate And dteWeek6 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek6 = True
intPhase6 = rs!Phase
End If

'Week 7 check
If dteWeek7 >= rs!sDate And dteWeek7 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek7 = True
intPhase7 = rs!Phase
End If

'Week 8 check
If dteWeek8 >= rs!sDate And dteWeek8 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek8 = True
intPhase8 = rs!Phase
End If

'Week 9 check
If dteWeek9 >= rs!sDate And dteWeek9 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek9 = True
intPhase9 = rs!Phase
End If

'Week 10 check
If dteWeek10 >= rs!sDate And dteWeek10 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek10 = True
intPhase10 = rs!Phase
End If

'Week 11 check
If dteWeek11 >= rs!sDate And dteWeek11 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek11 = True
intPhase11 = rs!Phase
End If

'Week 12 check
If dteWeek12 >= rs!sDate And dteWeek12 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek12 = True
intPhase12 = rs!Phase
End If

'Week 13 check
If dteWeek13 >= rs!sDate And dteWeek13 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek13 = True
intPhase13 = rs!Phase
End If

'Week 14 check
If dteWeek14 >= rs!sDate And dteWeek14 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek14 = True
intPhase14 = rs!Phase
End If

'Week 15 check
If dteWeek15 >= rs!sDate And dteWeek15 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek15 = True
intPhase15 = rs!Phase
End If

'Week 16 check
If dteWeek16 >= rs!sDate And dteWeek16 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek16 = True
intPhase16 = rs!Phase
End If

'Week 17 check
If dteWeek17 >= rs!sDate And dteWeek17 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek17 = True
intPhase17 = rs!Phase
End If

'Week 18 check
If dteWeek18 >= rs!sDate And dteWeek18 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek18 = True
intPhase18 = rs!Phase
End If

'Week 19 check
If dteWeek19 >= rs!sDate And dteWeek19 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek19 = True
intPhase19 = rs!Phase
End If

'Week 20 check
If dteWeek20 >= rs!sDate And dteWeek20 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek20 = True
intPhase20 = rs!Phase
End If

'Week 21 check
If dteWeek21 >= rs!sDate And dteWeek21 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek21 = True
intPhase21 = rs!Phase
End If

'Week 22 check
If dteWeek22 >= rs!sDate And dteWeek22 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek22 = True
intPhase22 = rs!Phase
End If

'Week 23 check
If dteWeek23 >= rs!sDate And dteWeek23 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek23 = True
intPhase23 = rs!Phase
End If

'Week 24 check
If dteWeek24 >= rs!sDate And dteWeek24 <= rs!eDate Then
'column heading date is between start and end date -
mark this column true to display bar
booWeek24 = True
intPhase24 = rs!Phase
End If

rs.MoveNext
Else
'no match
'write previous record and continue
strSQL = "INSERT INTO tblScheduleBar (DistrictID, Category,
ActivityShortDesc, Comments, "
strSQL = strSQL & "Week1, Week2 , Week3, Week4, Week5,
Week6, Week7, Week8, Week9, Week10, "
strSQL = strSQL & "Week11, Week12, Week13, Week14, Week15,
Week16, Week17, Week18, Week19, "
strSQL = strSQL & "Week20, Week21, Week22, Week23, Week24,
p1, p2, p3, p4, p5, p6, p7, p8, "
strSQL = strSQL & "p9, p10, p11, p12, p13, p14, p15, p16,
p17, p18, p19, p20, p21, p22, p23, p24, RunTime) "
strSQL = strSQL & "VALUES ('" & strDistrict & "', '" &
strCategory & "', '" & strActivity & "', '"
strSQL = strSQL & strComments & "', "
strSQL = strSQL & booWeek1 & ", " & booWeek2 & ", " &
booWeek3 & ", "
strSQL = strSQL & booWeek4 & ", " & booWeek5 & ", " &
booWeek6 & ", " & booWeek7 & ", "
strSQL = strSQL & booWeek8 & ", " & booWeek9 & ", " &
booWeek10 & ", " & booWeek11 & ", "
strSQL = strSQL & booWeek12 & ", " & booWeek13 & ", " &
booWeek14 & ", " & booWeek15
strSQL = strSQL & ", " & booWeek16 & ", " & booWeek17 & ", "
& booWeek18 & ", " & booWeek19 & ", "
strSQL = strSQL & booWeek20 & ", " & booWeek21 & ", " &
booWeek22 & ", " & booWeek23 & ", "
strSQL = strSQL & booWeek24 & ", " & intPhase1 & ", " &
intPhase2 & ", " & intPhase3 & ", "
strSQL = strSQL & intPhase4 & ", " & intPhase5 & ", " &
intPhase6 & ", " & intPhase7 & ", "
strSQL = strSQL & intPhase8 & ", " & intPhase9 & ", " &
intPhase10 & ", " & intPhase11 & ", "
strSQL = strSQL & intPhase12 & ", " & intPhase13 & ", " &
intPhase14 & ", " & intPhase15 & ", "
strSQL = strSQL & intPhase16 & ", " & intPhase17 & ", " &
intPhase18 & ", " & intPhase19 & ", "
strSQL = strSQL & intPhase20 & ", " & intPhase21 & ", " &
intPhase22 & ", " & intPhase23 & ", "
strSQL = strSQL & intPhase24 & ", #" & dteFreezeTime & "#)"

DoCmd.SetWarnings False
DoCmd.RunSQL (strSQL) 'write previous record and contine
ERROR OCCURS HERE

'initialize variables
strDistrict = Nz(rs!DistrictID, " ")
strCategory = Nz(rs!Category, " ")
strActivity = Nz(rs!ActivityShortDesc, " ")
strComments = Nz(rs!ActivityDescription, " ")
booWeek1 = False
booWeek2 = False
booWeek3 = False
booWeek4 = False
booWeek5 = False
booWeek6 = False
booWeek7 = False
booWeek8 = False
booWeek9 = False
booWeek10 = False
booWeek11 = False
booWeek12 = False
booWeek13 = False
booWeek14 = False
booWeek15 = False
booWeek16 = False
booWeek17 = False
booWeek18 = False
booWeek19 = False
booWeek20 = False
booWeek21 = False
booWeek22 = False
booWeek23 = False
booWeek24 = False
End If
Loop
'write last record
strSQL = "INSERT INTO tblScheduleBar (DistrictID, Category,
ActivityShortDesc, Comments, "
strSQL = strSQL & "Week1, Week2 , Week3, Week4, Week5, Week6, Week7,
Week8, Week9, Week10, "
strSQL = strSQL & "Week11, Week12, Week13, Week14, Week15, Week16,
Week17, Week18, Week19, "
strSQL = strSQL & "Week20, Week21, Week22, Week23, Week24, p1, p2,
p3, p4, p5, p6, p7, p8, "
strSQL = strSQL & "p9, p10, p11, p12, p13, p14, p15, p16, p17, p18,
p19, p20, p21, p22, p23, p24, RunTime) "
strSQL = strSQL & "VALUES ('" & strDistrict & "', '" & strCategory &
"', '" & strActivity & "', '"
strSQL = strSQL & strComments & "', "
strSQL = strSQL & booWeek1 & ", " & booWeek2 & ", " & booWeek3 & ", "
strSQL = strSQL & booWeek4 & ", " & booWeek5 & ", " & booWeek6 & ",
" & booWeek7 & ", "
strSQL = strSQL & booWeek8 & ", " & booWeek9 & ", " & booWeek10 & ",
" & booWeek11 & ", "
strSQL = strSQL & booWeek12 & ", " & booWeek13 & ", " & booWeek14 &
", " & booWeek15
strSQL = strSQL & ", " & booWeek16 & ", " & booWeek17 & ", " &
booWeek18 & ", " & booWeek19 & ", "
strSQL = strSQL & booWeek20 & ", " & booWeek21 & ", " & booWeek22 &
", " & booWeek23 & ", "
strSQL = strSQL & booWeek24 & ", " & intPhase1 & ", " & intPhase2 &
", " & intPhase3 & ", "
strSQL = strSQL & intPhase4 & ", " & intPhase5 & ", " & intPhase6 &
", " & intPhase7 & ", "
strSQL = strSQL & intPhase8 & ", " & intPhase9 & ", " & intPhase10 &
", " & intPhase11 & ", "
strSQL = strSQL & intPhase12 & ", " & intPhase13 & ", " & intPhase14
& ", " & intPhase15 & ", "
strSQL = strSQL & intPhase16 & ", " & intPhase17 & ", " & intPhase18
& ", " & intPhase19 & ", "
strSQL = strSQL & intPhase20 & ", " & intPhase21 & ", " & intPhase22
& ", " & intPhase23 & ", "
strSQL = strSQL & intPhase24 & ", #" & dteFreezeTime & "#)"

DoCmd.RunSQL (strSQL)
DoCmd.SetWarnings True

Me.Filter = "[RunTime] = #" & dteFreezeTime & "#"
Me.FilterOn = True
Else
MsgBox "No Data Found for 16 weeks following "
DoCmd.Close
End If

Exit_Sub:
Exit Sub
ErrorRoutine:
Call LogError(Err.Number, Err.Description, "Report: rptProjectSchedule;
Sub: Report_Open", , True)
Resume Exit_Sub
End Sub
 
T

Tony Toews [MVP]

SuzyQ said:
It occurs at

DoCmd.RunSQL (strSQL) 'write previous record and continue statement when

strsql = "INSERT INTO tblScheduleBar (DistrictID, Category,
ActivityShortDesc, Comments, Week1, Week2 , Week3, Week4, Week5, Week6,
Week7, Week8, Week9, Week10, Week11, Week12, Week13, Week14, Week15, Week16,
Week17, Week18, Week19, Week20, Week21, Week22, Week23, Week24, p1, p2, p3,
p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19,
p20, p21, p22, p23, p24, RunTime) VALUES (' ', 'Awarded Grants/CoOps',
'9-Mile Paving (LHTAC)', ' ', False, False, False, False, False, False,
False, True, True, True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, #7/20/2009 12:19:02 PM#)"

Is DistrictID a numeric field or text field? If text field are the
properties set to allow a zero length field? Quite possibly the first
'' should really be Null.

Also what error do you get if you use

currentdb.exectue strsql, dbfailonerror
instead of
docmd.runsql

Tony
 
S

SuzyQ

Text field. Typically it will have data such as R1, R2, R3, R4, WD for
District 1 roads, district 2 roads, etc. WD is the Weed Department, or it
could be SW for Solid Waste etc.
 
S

SuzyQ

Sorry, I didn't finish answering your questions before I posted previous. The

The field is text. Length -2; Required -No; Allow Zero Length -No

currentdb.execute strsql, dbfailonerror - gives me the same Error number 3000
 
S

SuzyQ

Well, maybe the report code was corrupt or something. I keep a backup of all
my code in individual text files and I set the report's HasModule value to no
and then restored from the text file. It works fine now. Nothing looks
different in the code so I guess that's it.

Thanks for all your help. However, I've been experiencing a pretty high
corruption rate. My data is split into a backend and frontend. I don't edit
code while I'm running code, any other ideas on how my application keeps
getting corrupted?
 
T

Tony Toews [MVP]

SuzyQ said:
The field is text. Length -2; Required -No; Allow Zero Length -No

Then you can't give that field a zero length string. "" So try Null
there instead.
currentdb.execute strsql, dbfailonerror - gives me the same Error number 3000

Interesting.

Tony
 
S

SuzyQ

I'll try that. Thanks

KenSheridan via AccessMonster.com said:
Its impossible to say categorically. If you get this sort of problem try
opening the application with the undocumented /decompile command line option.
That will force the code to recompile. You can only do this with a .mdb file
of course, not a .mde file.

Ken Sheridan
Stafford, England
 
S

SuzyQ

I'll try that. Thanks

KenSheridan via AccessMonster.com said:
Its impossible to say categorically. If you get this sort of problem try
opening the application with the undocumented /decompile command line option.
That will force the code to recompile. You can only do this with a .mdb file
of course, not a .mde file.

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top