[AccessD] OpenArgs help [WAS] Citing entered data range on report

Dan Waters df.waters at comcast.net
Fri Jun 7 11:31:52 CDT 2013


Hi John,

In this email, the beginning date text field in the report code is
misspelled - it's missing the 'e'.  That would give you a compile error.

Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Clark
Sent: Friday, June 07, 2013 11:22 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] OpenArgs help [WAS] Citing entered data range on report

Well, I went your way. I knew you were correct, and I was just being lazy.
However, I have never used OpenArgs, and I'm struggling a bit. 
 
Here is what I have so far...
 
The calling form, has fields txtBegDate and txtEndDate, and then a button
w/the code: 
 
stDocName = "qryWitnessLog_DatePicker"
DoCmd.OpenReport stDocName, acPreview, , , , txtBegDate.Value & "|" &
txtEndDate.Value

Then in the OnOpen event of the rereport, I have...
 
Dim aryOA As Variant
aryOA = Split(Me.OpenArgs, "|")
 
Me.txtBegDat.Value = aryOA(0)
Me.txtEndDate.Value = aryOA(1)
 
This latter code is something I found on the Internet. 
 
This doesn't work though...I am getting a compile error..."Method or Data
Member Not Found"
 
I've got everything working except for putting the date range (start date &
end date) on the report. If there is another way to do this, I'd be open to
it. But, I don't know how to do this w/out the calling form being in the way
of the report preview. I guess I could just print it out, but that isn't
right either...
 
 

>>> Charlotte Foust <charlotte.foust at gmail.com> 5/29/2013 2:22 PM >>>
You could return the parameters in the query by creating an expression field
for each. That would allow you to see it in the report, but I prefer to
capture start and end dates in the form that selects the report and pass it
into the report in OpenArgs.

Charlotte

On Wed, May 29, 2013 at 11:16 AM, John Clark
<John.Clark at niagaracounty.com>wrote:

> I am creating this report for our DA's office, that let's them enter a 
> start date and an ending date, and it shows all witness fees & mileage 
> paid out for that range, with a total at the end. What I do not have 
> though...and maybe I'm just having a brain-dead moment here...is the 
> range that it covers. I'd like it to list the range somewhere on the
report.
>
> Now, I did this the quick and easy way and had it based on a query, 
> and it is in that query that I placed the spot for date entries, by 
> putting the code, ">=[StartDate] And <=[EndDate]" in the date field. 
> Is there a way to use this entered info, or do I need to create an 
> input form and have the dates entered there?
>

Notice: This electronic transmission is intended for the sole use of the
individual or entity to which it is addressed and may contain confidential,
privileged or otherwise legally protected information. If you are not the
intended recipient, or if you believe you are not the intended recipient,
you are hereby notified that any use, disclosure, copying, distribution, or
the taking of any action in reliance on the contents of this information, is
strictly prohibited. Niagara County is not responsible for the content of
any external hyperlink referenced in this email or any email. 
IF YOU HAVE RECEIVED THIS TRANSMISSION IN ERROR, PLEASE NOTIFY THE SENDER
IMMEDIATELY BY EMAIL AND DELETE THE ORIGINAL MESSAGE ALONG WITH ANY PAPER OR
ELECTRONIC COPIES. 
Thank you for your cooperation.



More information about the AccessD mailing list