A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Getting information From Form to report



 
 
Thread Tools Display Modes
  #1  
Old August 15th, 2006, 04:16 PM posted to microsoft.public.access.reports
[email protected]
external usenet poster
 
Posts: 2
Default Getting information From Form to report

Hey all,

i have designed an invoice as a form but inorder for me to print out a
professional invoice i want it to print from a report. I want to take
information from the form to the report so i can produce a professional
invoice. How would i go about doing this? I have tried using the
expression builder and taking fields from the form but i end up with
errors such as '#name?' in teh fields i want. All help would be
smashing

  #2  
Old August 15th, 2006, 04:21 PM posted to microsoft.public.access.reports
Rick B
external usenet poster
 
Posts: 749
Default Getting information From Form to report

Are you saving all the data in a table? If so, just ask the user which invoice to print, and the print it. Use a prompt in your query.

If you have a form and you want to add a button to print only that particular invoice, use code similar to the following...

Button to print specific record
Private Sub cmdPrint_Click()

Dim strWhere As String

If Me.Dirty Then 'Save any edits.

Me.Dirty = False

End If

If Me.NewRecord Then 'Check there is a record to print

MsgBox "Select a record to print"

Else

strWhere = "[ID] = " & Me.[ID]

DoCmd.OpenReport "MyReport", acViewPreview, , strWhere

End If

End Sub



Notes: If your primary key is a Text type field (not a Number type field), you need extra quotes: strWhere = "[ID] = """ & Me.[ID] & """"

If you want the report to print without preview, replace acViewPreview with acViewNormal.



See also: http://allenbrowne.com/casu-15.html



--
Rick B



wrote in message oups.com...
Hey all,

i have designed an invoice as a form but inorder for me to print out a
professional invoice i want it to print from a report. I want to take
information from the form to the report so i can produce a professional
invoice. How would i go about doing this? I have tried using the
expression builder and taking fields from the form but i end up with
errors such as '#name?' in teh fields i want. All help would be
smashing

  #3  
Old August 15th, 2006, 04:31 PM posted to microsoft.public.access.reports
[email protected]
external usenet poster
 
Posts: 2
Default Getting information From Form to report

Thanks for the info rick, the info was great but i can print from the
invoice in form view but i want to design a report so my invoice looks
better, for example add a logo, look up customer details from their id
and print this on top of the invoice. How would i transfer information
from the invoice form to a report(invoice). I am not saving all my
information from the form to my invoice and invoice details table. I
work out calculations such as subtotal, total before tax and others
through the form.(i can work these calculatiosn again from using these
in the report right? ) All help would be great

have a nice day

  #4  
Old August 22nd, 2006, 03:39 AM posted to microsoft.public.access.reports
Larry Linson
external usenet poster
 
Posts: 3,112
Default Getting information From Form to report


wrote in message
oups.com...
Thanks for the info rick, the info was great but i can print from the
invoice in form view but i want to design a report so my invoice looks
better, for example add a logo, look up customer details from their id
and print this on top of the invoice. How would i transfer information
from the invoice form to a report(invoice). I am not saving all my
information from the form to my invoice and invoice details table. I
work out calculations such as subtotal, total before tax and others
through the form.(i can work these calculatiosn again from using these
in the report right? ) All help would be great


Obviously, you have the calculations in the Form. Copy and paste them into
the Report, modify as necessary. Reports are "driven" by data from their
RecordSource, which will be a reference to a Query, an SQL Statement, or a
Table. Transferring data from an _open_ Form is possible, but it is better
to include the same/similar calculations in the Report. Use the Form's
identifier for the invoice ID to be printed... assuming you use a
DoCmd.OpenReport in the Click event code of a Command Button on the Form,
check help on the WhereCondition argument of DoCmd.OpenReport.

Larry Linson
Microsoft Access MVP




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:12 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.