In the AfterUpdate event of the drop-down box, put in code like:
If Me.cboStatus = "Supplied" then ' or key value of cboStatus
DoCmd.RunCommand acCommandSaveRecord
DoCmd.OpenReport "rptInvoice",acPreview,,"[yourKeyField]=" & txtKeyField
End If
The first line saves the current record, the second does the print.
I generally prefer to do reports in preview rather than print mode, giving
the user the chance to see that everything is right, but you can do acPrint
instead. (I believe those are the choices; you should get the options
showing up as you enter the code in the module.) The last piece is the
criteria line that limits the report to the record you are on; txtKeyField
can be made with Visible=False.
Tobi
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] Behalf Of Ozzwald
Sent: Sunday, June 19, 2005 6:02 PM
To: [email protected]
Subject: [AccessDevelopers] Printing From a form
I have a Form which includes a drop down box. I want to be able to
print a report(Invoice) based on this record when the drop down box
is
changed to 'supplied' What code do I use? Many thanks
Please zip all files prior to uploading to Files section.
Yahoo! Groups Links
Please zip all files prior to uploading to Files section.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AccessDevelopers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/