Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Test for BOF in a recordset

Posted on 2004-03-20
2
Medium Priority
?
252 Views
Last Modified: 2006-11-17
Here is the SQL statement I currently have:

SELECT tblEqpt.EqptID, NZ([Amount],"0") AS CalcAmount, NZ([COAmount],"0") AS CalcCOAmount, NZ([InvoiceAmount],"0") AS CalcInvoiceAmount, (NZ([Amount])+NZ([COAmount])-NZ([InvoiceAmount])) AS [Amount Remaining]
FROM tblReq INNER JOIN ((tblEqpt INNER JOIN tblChangeOrder ON tblEqpt.EqptID = tblChangeOrder.EqptID) INNER JOIN tblInvoice ON tblEqpt.EqptID = tblInvoice.EqptID) ON tblReq.ReqID = tblEqpt.ReqID
WHERE (((tblEqpt.EqptID)=[Forms]![frmRequisition]![txtLink]));

2 possibilities will exist
1. tblChangeOrder may not have any rows
2. tblInvoice may not have any rows

If this is the case, I need the calculation to be performed just as if [COAmount] were 0 and [InvoiceAmount] were 0.

I thank you in advance for your assistance.
0
Comment
Question by:CatDaddy2003
[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
2 Comments
 
LVL 54

Accepted Solution

by:
nico5038 earned 2000 total points
ID: 10641882
As described in the other question, you'll need the so-called outer-join.

Double-click the connection lines between the three tables and change the option into 2 or 3 making tblEqpt leading.

Nic;o)
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 10641902
Save your query as Query1

Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim rs As Recordset
    Set db = CurrentDB()
    Set rst = db.OpenRecordset("Query1", dbOpenDynaset)
     
  If rst.BOF = True Then  'No records

 'your codes for calculation

    End If
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

604 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