Reports!StandardInvoice!BIType="Invoice" - not executing as expect

J

Jay

In the following event procedure, I'm trying to set the value of a report
textbox named 'BIType' to the string value "Invoice" when the report is
previewed. The report previews just fine when the button btnBillToAccount is
pressed, with the exception that the textbox BIType on the report is blank.
Why doesn't textbox BIType display the string "Invoice" ?

Private Sub btnBillToAccount_Click()

On Error GoTo Err_PreviewInvoice_Click
DoCmd.OpenReport "StandardInvoice", acViewPreview, , "[JobID]=" & [JobID]
Reports!StandardInvoice!BIType = "Invoice"

Exit_PreviewInvoice_Click:
Exit Sub

Err_PreviewInvoice_Click:
MsgBox Err.Description
Resume Exit_PreviewInvoice_Click
End Sub
 
S

strive4peace

Hi Jay,

if the BIType control on your report gets its value from a form, use
this for the ControlSource in the report

=Forms!Formname!controlname

when you are assigning a controlsource, don't forget to start with an
equal sign and include delimiters, "='Invoice'"

....but I believe assingments need to be made from the design view or
code behind the report on open

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
S

strive4peace

very kind of you to say, Jay :) I am in concurrance on Marsh -- he is
great at being on target (thanks Marsh, you explained it so well and I
will remember too)

"Access arsenal" ... hmmm, is that like "VBA fireworks" <smile>

anyhow, nice to be part of the reason for a productive day ;)

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top