Solved

Run-time error 3075: Reserved Error

Posted on 2007-04-02
20
845 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
 

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

705 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now