[AccessD] OpenArgs Issue...I think

John Clark John.Clark at niagaracounty.com
Fri Sep 27 11:36:00 CDT 2013


I put out a report that uses OpenArgs to pass along the Beginning and Ending dates for a requested report. Here is the code that calls it...
 
DoCmd.OpenReport stDocName, acPreview, , , , txtBegDate.Value & "|" & txtEndDate.Value
 
And here is the code at the report end, OnOpen...
_________________________________________________________________________
Private Sub Report_Open(Cancel As Integer)
 
Dim aryOA As Variant
aryOA = Split(Me.OpenArgs, "|")
 
Me.lblBegDate.Caption = aryOA(0)
Me.lblEndDate.Caption = aryOA(1)
 
End Sub
_________________________________________________________________________
 
I was asked to do another report...on Voucher Number, instead of Date. I lacked forsight when I created this thing, and to make up for it, I figured starting and ending number would be the same as starting and ending date, and that is fine. But, for some reason, when I call the report for number, I get an error, "Invalid Use of Null" 
 
This error takes me to the OnOpen code above. 
 
I put in some test field, on the calling form, and verified that these number ARE going into the two values I am sending. 
 
Any ideas?
 

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