Group:  Microsoft Access ยป microsoft.public.access.reports
Thread: Print Report for current Invoice Number

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Print Report for current Invoice Number
"Maureen227" <maureen227[ at ]cox.net> 27.07.2006 01:56:29
I have a form with invoice data and would like to print a report with a
button on the form. My problem is I don't know how to tell the report
to print for the current record's invoice number.

Any help would be great. Thanks ahead
Maureen

Re: Print Report for current Invoice Number
fredg <fgutkind[ at ]example.invalid> 27.07.2006 02:00:30
On 26 Jul 2006 18:56:29 -0700, Maureen227 wrote:

[Quoted Text]
> I have a form with invoice data and would like to print a report with a
> button on the form. My problem is I don't know how to tell the report
> to print for the current record's invoice number.
>
> Any help would be great. Thanks ahead
> Maureen

Assuming the Invoice number is a unique prime key field and is a
Number datatype, not text:

DoCmd.OpenReport "ReportName", acViewPreview, , "[InvoiceNumber] = " &
Me![InvoiceNumber]

If [InvoiceNumber] is text, then use:

DoCmd.OpenReport "ReportName", acViewPreview, , "[InvoiceNumber] = '"
& Me![InvoiceNumber] & "'"

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Re: Print Report for current Invoice Number
"Maureen227" <maureen227[ at ]cox.net> 27.07.2006 02:16:00

fredg wrote:
[Quoted Text]
> On 26 Jul 2006 18:56:29 -0700, Maureen227 wrote:
>
> > I have a form with invoice data and would like to print a report with a
> > button on the form. My problem is I don't know how to tell the report
> > to print for the current record's invoice number.
> >
> > Any help would be great. Thanks ahead
> > Maureen
>
> Assuming the Invoice number is a unique prime key field and is a
> Number datatype, not text:
>
> DoCmd.OpenReport "ReportName", acViewPreview, , "[InvoiceNumber] = " &
> Me![InvoiceNumber]
>
> If [InvoiceNumber] is text, then use:
>
> DoCmd.OpenReport "ReportName", acViewPreview, , "[InvoiceNumber] = '"
> & Me![InvoiceNumber] & "'"
>
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail

Fred
This work great. Thanks a Terabyte.
My in voice number was a text box and i was using the code for a number
field.
Maureen

Re: Print Report for current Invoice Number
Bon43 23.08.2006 22:17:01
this works great, however - how can we capture any new data on this form -
not showing up when the button is pushed.
Thanks,


"fredg" wrote:

[Quoted Text]
> On 26 Jul 2006 18:56:29 -0700, Maureen227 wrote:
>
> > I have a form with invoice data and would like to print a report with a
> > button on the form. My problem is I don't know how to tell the report
> > to print for the current record's invoice number.
> >
> > Any help would be great. Thanks ahead
> > Maureen
>
> Assuming the Invoice number is a unique prime key field and is a
> Number datatype, not text:
>
> DoCmd.OpenReport "ReportName", acViewPreview, , "[InvoiceNumber] = " &
> Me![InvoiceNumber]
>
> If [InvoiceNumber] is text, then use:
>
> DoCmd.OpenReport "ReportName", acViewPreview, , "[InvoiceNumber] = '"
> & Me![InvoiceNumber] & "'"
>
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail
>
Re: Print Report for current Invoice Number
fredg <fgutkind[ at ]example.invalid> 24.08.2006 16:33:16
On Wed, 23 Aug 2006 15:17:01 -0700, Bon43 wrote:

[Quoted Text]
> this works great, however - how can we capture any new data on this form -
> not showing up when the button is pushed.
> Thanks,
>
> "fredg" wrote:
>
>> On 26 Jul 2006 18:56:29 -0700, Maureen227 wrote:
>>
>>> I have a form with invoice data and would like to print a report with a
>>> button on the form. My problem is I don't know how to tell the report
>>> to print for the current record's invoice number.
>>>
>>> Any help would be great. Thanks ahead
>>> Maureen
>>
>> Assuming the Invoice number is a unique prime key field and is a
>> Number datatype, not text:
>>
>> DoCmd.OpenReport "ReportName", acViewPreview, , "[InvoiceNumber] = " &
>> Me![InvoiceNumber]
>>
>> If [InvoiceNumber] is text, then use:
>>
>> DoCmd.OpenReport "ReportName", acViewPreview, , "[InvoiceNumber] = '"
>> & Me![InvoiceNumber] & "'"
>>
>> --
>> Fred
>> Please respond only to this newsgroup.
>> I do not reply to personal e-mail
>>

Newly entered data in a form is not saved until you close the form,
move to another record, or explicitly tell it to save the record.

Add one line of code to the command button click event to first save
the record:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "Reportname", etc......
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net