473,480 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1589
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
2387
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
295
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
2809
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
2624
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
13650
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
9926
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
9376
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
3510
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
5433
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
6912
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7052
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,...
1
6744
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
6981
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...
1
4790
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2989
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
565
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.