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
Solved

Run-time error 3075: Reserved Error

Posted on 2007-04-02
20
850 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 - 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

839 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