?
Solved

Run-time error 3075: Reserved Error

Posted on 2007-04-02
20
Medium Priority
?
856 Views
Last Modified: 2008-02-01
I'm stumped. I'm getting this error Run-time error 3075: Reserved Error. Debug identifies the If line in the following code:

Private Sub Form_AfterUpdate()
  Dim strQryName As String
  strQryName = "qupdTxSchRecd"

>If Me.cboUbTxPrQtyRcd = Forms!frmTxRecd!fsubTxSchUnRecd2.Form!cboUbTxPrQtySch Then
    DoCmd.SetWarnings False
    DoCmd.OpenQuery strQryName, acNormal, acEdit
    Me.Parent.fsubTxSchUnRecd2.Requery
    Me.Parent.fsubTxSchUnRecd2.SetFocus
    DoCmd.SetWarnings True
  End If
 
End Sub

The control source for Forms!frmTxRecd!fsubTxSchUnRecd2.Form!cboUbTxPrQtySch is
=nz(DSum("lngShpQty","qsubTxSchActive","lngTxID=" & Forms!frmTxRecd!fsubTxSchUnRecd2.Form!txtUbTxID & " AND lngProdID=" & Forms!frmTxRecd!fsubTxSchUnRecd2.Form!txtUbProdID & " AND dtmCncld Is Null"),0)

Me.cboUbTxPrQtyRcd
=DCount("lngProdSnID","tblProdSn","lngTxRecdId =" & Forms!frmTxRecd!fsubProdSN.Form!cboTxRecdID)

The error only triggers when there are no records in the subform. Can you see where the problem might be?

E
0
Comment
Question by:eliwil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
  • 5
  • +1
20 Comments
 
LVL 34

Accepted Solution

by:
jefftwilley earned 700 total points
ID: 18841113
If nz(Me.cboUbTxPrQtyRcd) = nz(Forms!frmTxRecd!fsubTxSchUnRecd2.Form!cboUbTxPrQtySch) Then

null can't be compared...nz here will solve it. But you run a risk here that if both are null, then the IF will be TRUE
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 600 total points
ID: 18841119
Just for good measure, try this and see if the problem disappears ....

Follow this procedure:

1) Compact and Repair
2) Execute the Decompile >> you database will reopen
3) Close the mdb
4) Open the mdb ... and then do a Compile (from the VBA Editor >> Menu >>Debug>>Compile<YourProjectName>)
5) Close the mdb
6) Compact and Repair one more time.


Here are sample 'links'.  Adjust your paths and file names accordingly:

Run this from Start>>Run, enter the following command line:

"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile C:\Access2003Clients\GoldstandtSma\App\SmaApp2K3.mdb


"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile C:\Access2003Clients\GoldstandtPdm\App\PdmAppl2K3.mdb

"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile C:\Access2003Clients\GoldstandtSma\App\SmaAppl2K3.mdb

"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile C:\Access2003Clients\HMC\App\AimAppl2K3.mdb

"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile "C:\Program Files\Microsoft Office\Office\ADIvba11LIB.mda"

For more detail on the Decompile subject ... visit the Master on the subject (and other great stuff) Michael Kaplan:

http://www.trigeminal.com/usenet/usenet004.asp?1033

mx
0
 
LVL 9

Assisted Solution

by:TheSloath
TheSloath earned 700 total points
ID: 18841123
If thre are no records in the subform then the Combobox probably doesn't exist, so test for records before trying to run the code, e.g.

If Forms!frmTxRecd!fsubTxSchUnRecd2.Form.Recordset.RecordCount > 0 Then
    If Me.cboUbTxPrQtyRcd = Forms!frmTxRecd!fsubTxSchUnRecd2.Form!cboUbTxPrQtySch Then
        DoCmd.SetWarnings False
        DoCmd.OpenQuery strQryName, acNormal, acEdit
        Me.Parent.fsubTxSchUnRecd2.Requery
        Me.Parent.fsubTxSchUnRecd2.SetFocus
        DoCmd.SetWarnings True
    End If
End If
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:eliwil
ID: 18841162
When I use the IF above I get the following:
Run-time error -2147352567 (80020009) Reserved Error and Error in the control itself.

Again, errors only happen when the subform has no records.

E
0
 
LVL 75
ID: 18841167
Try the Decompile ... I have seen it fix many a Reserved Error.  It's simple and you may get lucky.

mx
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18841168
then Sloath has you covered
0
 
LVL 75
ID: 18841170
Do a Backup first !!!

mx
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18841173
lol
Always good advice.

Time for zzzz's here. I'm out
J
0
 
LVL 75
ID: 18841192
Time for '24' ... I'm out for an hour !!!

mx
0
 
LVL 9

Expert Comment

by:TheSloath
ID: 18841194
U have 2 subforms. Which one has no records in?

The line below could be causing problems if there are no records in fsubProdSN:

DCount("lngProdSnID","tblProdSn","lngTxRecdId =" & Forms!frmTxRecd!fsubProdSN.Form!cboTxRecdID)
0
 

Author Comment

by:eliwil
ID: 18841279
DatabaseMX:, Did the above. Still get the same error.
0
 
LVL 75
ID: 18841314
Did you try Sloath's solution ?

mx
0
 

Author Comment

by:eliwil
ID: 18841378
Did the decompile and still get error.
With Nz get Run-time error -2147352567 (80020009) Reserved Error and Error in the control itself.
With recordsetclone approach above get the Run-time error 3075: Reserved Error
0
 
LVL 9

Expert Comment

by:TheSloath
ID: 18841383
U have 2 subforms. Which one has no records in?

The line below could be causing problems if there are no records in fsubProdSN:

DCount("lngProdSnID","tblProdSn","lngTxRecdId =" & Forms!frmTxRecd!fsubProdSN.Form!cboTxRecdID)
0
 
LVL 9

Expert Comment

by:TheSloath
ID: 18841427
So what solved it in the end?
0
 
LVL 75
ID: 18841446
Yes ... what did ??  Was it just evil forces from outer space ?

mx
0
 
LVL 9

Expert Comment

by:TheSloath
ID: 18841450
The Force Padawan...


:-)
0
 
LVL 75
ID: 18841474
Only Da Sloath Knows For Sure !!! *** !!! :-)
0
 

Author Comment

by:eliwil
ID: 18841625
I ditched the forms in this version of the database and went back to a previous version to work with the form and subforms. Yahoo, no run time errors! Just needed a few tweaks to get the result I needed and imported the revised form and subs into the current database.

Thanks for all the help!
0
 

Author Comment

by:eliwil
ID: 18841635
It was either those evil forces from outerspace or gremlins. I'm leaning toward the outerspace explanation myself ;-]

E
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question