Solved

Run-time error 3075: Reserved Error

Posted on 2007-04-02
20
852 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 175 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 150 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 175 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

749 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