Solved

Run-time error 3075: Reserved Error

Posted on 2007-04-02
20
848 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
  • 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 - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

809 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