473,413 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Report Headache

Using Access 2003 on Windows XP SP2

I have a report based on a query. It's meant to display a complete order, which is based on two tables, “Proposals” and “Orders”. In the proposal table, I quote “Sold As” prices as follows: Purchase, Lease or Reprogram.

When the final order is placed, the price is one of the three. On the report, “Complete Order”, I'd like to have an unbound text field that displays the price based on the value of the “Sold As” field.

I assume it's some kind of Select Case or If, Then, Else… and DLookup combination, but I can figure out the code. Basically, I want the report to run something like:

If [Report Field] Sold As = Lease then [Report Unbound Field] Price should show [Proposal Table Field] Lease

If [Report Field] Sold As = Purchase then [Report Unbound Field] Price should show [Proposal Table Field] Purchase

Otherwise [Report Unbound Field] Price should show “N/A”
Aug 8 '07 #1
2 1331
Rabbit
12,516 Expert Mod 8TB
Do it through a query instead and bind the report to the query.
Aug 20 '07 #2
ADezii
8,834 Expert 8TB
Using Access 2003 on Windows XP SP2

I have a report based on a query. It's meant to display a complete order, which is based on two tables, “Proposals” and “Orders”. In the proposal table, I quote “Sold As” prices as follows: Purchase, Lease or Reprogram.

When the final order is placed, the price is one of the three. On the report, “Complete Order”, I'd like to have an unbound text field that displays the price based on the value of the “Sold As” field.

I assume it's some kind of Select Case or If, Then, Else… and DLookup combination, but I can figure out the code. Basically, I want the report to run something like:

If [Report Field] Sold As = Lease then [Report Unbound Field] Price should show [Proposal Table Field] Lease

If [Report Field] Sold As = Purchase then [Report Unbound Field] Price should show [Proposal Table Field] Purchase

Otherwise [Report Unbound Field] Price should show “N/A”
What you are requesting can typically be done in the Format() Event of the Detail Section:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2. Select Case Me![Sold As]
  3.   Case "Purchase"
  4.     Me![txtUnbound] = "some string"
  5.   Case "Lease"
  6.     Me![txtUnbound] = "some string"
  7.   Case "Reprogram"
  8.     Me![txtUnbound] = "some string"
  9.   Case Else
  10.     Me![txtUnbound] = "N/A"
  11. End Select
  12. End Sub
Aug 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: David | last post by:
On every web browser except Safari, this website works great. (Well, by "every" I mean Mozilla, Netscape, and Internet Explorer, for Mac and Windows). The site is: http://www.ruleofthirds.com ...
3
by: CSDunn | last post by:
Hello, I have a situation in which each record on a report has 40 fields, any one of which can contain a value of 'C', or 'I', or 'B'. I need to create one calculated field on the report that will...
1
by: Geir Baardsen | last post by:
Hi! To Darryll Kerkeslager: Sorry..Something seems to happen when trying to answer your comment. U did understand it right. Of course I'll have an underlying query with the same fields. ...
5
by: Ryan Ternier | last post by:
I'm having an issue with an SQL insert statement. It's a very simple statement, and it's causing too much fuss. strSQL = "INSERT INTO tblFieldLayouts(TypeID, FieldID, OrderID, Hidden) VALUES("...
3
by: laurenq uantrell | last post by:
I'm trying to return an integer from the following table that returns the number of unique cities: tblEmployees Name City John Boston Frank New York Jim Omaha Betty ...
12
by: NuB | last post by:
The validation controls are giving me a headache. here is what i'm trying to do and so far what I've tried has not worked. I need to hide my grid if the page is not valid how can i accomplish...
5
by: James Ma | last post by:
Now I am debugging a buggy VB.NET function like following Function foo() Try ‘ many loops and codes and nested try catch here! …… Catch (ex as Exception) Msgbox ex.message Finally …
2
by: riyazthandora | last post by:
Dear guys I have problem with my crystal report especially in the morning in windows 2000 server machine. I am using a VB program and Database as MS Access. Reports are working fine. But sometimes...
0
by: zahiran | last post by:
Hello there... I want to ask about using crystal report in VB.Net...involving SQL Server 2000 first of all, my application is a win-based application n i used VB.Net... i have created 2 forms,...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.