By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,483 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,483 IT Pros & Developers. It's quick & easy.

How do I print a report with data JUST taken from a form?

P: n/a
What I'm trying to have done is the following:
After data is entered into a form, I want the user to click the
"Submit and print" button, which solidifies the data in the tables,
then prints a report based on the most recent data.

Do I need an autonumber column and have the report be based off the
largest record number or is there an easier way to do it? Also, I'm
not at all familiar with VBA (my small DB experience is in Perl and
Oracle) so if there's a code snippet I could use, I'd greatly
appreciate it.

Thanks in advance!
Andrew
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
sp****@gnt.net (Andrew) wrote in
news:d8**************************@posting.google.c om:
What I'm trying to have done is the following:
After data is entered into a form, I want the user to click
the "Submit and print" button, which solidifies the data in
the tables, then prints a report based on the most recent
data.

Do I need an autonumber column and have the report be based
off the largest record number or is there an easier way to do
it? Also, I'm not at all familiar with VBA (my small DB
experience is in Perl and Oracle) so if there's a code snippet
I could use, I'd greatly appreciate it.

Thanks in advance!
Andrew

What you want to do is have the report open filtered to only the
current record in the form, You may need the autonumber to
identify the record, but if some other field is guaranteed to be
unique to the record, use that instead.

So you would click on the button. and the OnClick event procedure
for the button would contain four statements, the first is

me.dirty = false
which saves the record.to the tables, then

then

DIM myrecord as long

The dim statement prepares a variable to hold your unique record
identifier

myrecord = "where tableuniquefield = " & me.uniqueformcontrol
this creates the filter

now all that's left is to open the report.

docmd.openreport "myreport",, myrecord.
..

Bob Quintal
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.