473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
1 1588
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jan | last post by:
I am having problems trying to print a report based on a form. This is a search form only, no data input. There is a query that the form looks at, but then there are numerous comboxes that you...
1
by: Andrew | last post by:
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...
24
by: Tony Girgenti | last post by:
Hello. Developing a Windows Form program in VS.NET VB, .NET Framework 1.1.4322 on a windows XP Pro, SP2. Before printing a document, i want to set the font to a font that is only available...
2
by: Rodo | last post by:
Hi all, We have a "testing report" form at work that we fill with data (typing for now). The form has a table, other lines and a company logo. I can make a windows form that will get the data...
4
by: sara | last post by:
Hi - I've looked at many posts, and cannot find the answer on this specific problem. I have several fields on a table, which I've defined as "Text", 3 characters, Format Yes/No (I picked up the...
2
by: Brad Pears | last post by:
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
12
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to...
6
by: Brett Barry: Go Get Geek! | last post by:
Hello, I have a main report with a Record Source, a DateToday table, that has the current Month and Year. I have about 60 queries, each pulling different data via ODBC, that I am creating...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.