473,395 Members | 1,442 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,395 software developers and data experts.

report parameter

Hi all,

I am creating a report which I am having some difficulties with on a few
technical bits,

when the report is ran it asks for the "billing date" which I enter and is
shown on the report - I need to use this to select which "rate" (field in
another table) then gets displayed. However I also have a "billed in" field
which is the currency to bill in and this must be used to select which
"rate" to display. I assume this can be done with an expression but nothing
I'm trying is working?

Basically I want to enter a value when the report is opened and from that
value select the related "rate" and related "currency"

hopefully someone willunderstand what I mean!

Thanx in advance for any help,

Dan
Nov 13 '05 #1
2 1169
How do you know what rate and what currency apply to the report? Is
this in another table? Seems like you've left out some key
information... because from what you've described, there should be
another table or query or something that joins these two pieces
together, and you don't describe it. Maybe take a step back and
explain (1) what you are trying to accomplish, (2) what relevant
tables/queries you have, and (3) what you've tried so far. If this is
just a matter of collecting bits of information to feed to the report,
you can use an unbound form for that...

Nov 13 '05 #2
Dan Kean wrote:
when the report is ran it asks for the "billing date" which I enter and is shown on the report - I need to use this to select which "rate" (field in another table) then gets displayed. However I also have a "billed in" field which is the currency to bill in and this must be used to select which "rate" to display. I assume this can be done with an expression but nothing I'm trying is working?

Basically I want to enter a value when the report is opened and from that value select the related "rate" and related "currency"


Use the Report_Open event. Use a recordset with SQL containing the
BillingDate surrounded by # signs to get the information you want.
Then use select case on the [billed in] field to change the display:

Something like:
'...
Dim Response As Variant
Dim strPrompt As String
Dim strTitle As String

strTitle = "Get Billing Date"
strPrompt = "Click OK or Type in a Billing Date"
Response = InputBox(strPrompt, strTitle, CStr(Date()))
lblBillingDate.Caption = Nz(Response, "")

'...
strSQL = "SELECT Rate, [billed in] AS BilledIn FROM tblRateHistory
WHERE theDate = #" & lblBillingDate.Caption & "#;"
dblRate = 0
strBilledIn = ""
If MyRS.RecordCount > 0 Then
MyRS.MoveFirst
dblRate = MyRS("Rate")
strBilledIn = MyRS("BilledIn")
End If
'...
If dblRate <> 0 Then
Select Case strBilledIn
Case "Euro":
lblBillingRate.Caption = Format(dblRate, "#.##0,00") & " Euros / hr"
Case "Doubloon":
lblBillingRate.Caption = Format(dblRate, "#,##0.00") & " Doubloons /
hr"
Case Else
lblBillingRate.Caption = "Currency type not available."
End Select
Else
txtBillingRate.Caption = "Rate info not available."
End If
DoEvents
'...

SQL might want the date to be Americanized. Test before using.

James A. Fortune

....just remember the user interface in Access uses the local Control
Panel settings to interpret dates typed into the user interface. --
Allen Browne

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
6
by: Mike Conklin | last post by:
This one really has me going. Probably something silly. I'm using dcount for a report to determine the number of different types of tests proctored in a semester. My report is based on a...
1
by: Marius Rus | last post by:
Could anyone tell me please how to write from the c# code in an parameter? For example I have an report that it is asking for a client code as the parameter. Now it is showing the interface from...
0
by: John F | last post by:
Hi, If there is a more appropriate group for this, please point me in the right direction. I have a Crystal Report .rpt file that I can get to launch from my code and I can view it. I pass...
0
by: Dean Sabella | last post by:
Hi, I was trying to run a crystal report in the .net sample application given at: http://support.crystaldecisions.com/communityCS/FilesAndUpdates/ cppnet_win_subreport_basic.exe.asp (I've...
1
by: Kapil Shah via DotNetMonster.com | last post by:
Hello Everybody, I am trying to write a crystal report function which should return a value of 1 for crystal report with no parameter and return a value 2 for crystal report with parameter. ...
0
by: Henry | last post by:
I have written an ASP/VB.Net application via VS 2003 (Crystal V9) that uses MS Access 2000 as its database. I can export reports that have no linked sub reports for printing. However, I'm unable...
0
by: Tumurbaatar S. | last post by:
It's my first project using the Crystal report. I created a report with the report designer and linked it to a web form as: 1. put CrystalReportViewer in my page (its ID: Viewer). 2. put...
0
by: kamboj.shalabh | last post by:
Hi to all, Well, I am working on dotnet 2005 with crystal reports 10 and backend as sql server. I am facing a problem while loading a report. Actually the issue is, when I load report it takes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.