473,396 Members | 1,942 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.

Printing Current Page on Form

14
Hell all, i really need some help.
I dont know how to use code at all, just started working with access07 for a month. Ive created a table name it freedom, i also created a Query from it named it freedom Query. and a report named new freedom. Here's the problem i have multiple clients on the form, but when i try to print the client info im currently viewing on my form on a report it prints all of the clients at once. i tried using a open report macro-view report and my where is set as passengerID which is my primary id for the freedom table. can you please tell me what im doing wrong. im very new at this.
Thanks alot.
Nov 9 '11 #1

✓ answered by ADezii

If you are asking how to Print the Current Record on a Form:
Expand|Select|Wrap|Line Numbers
  1. With DoCmd
  2.   .RunCommand acCmdSelectRecord
  3.   .PrintOut acSelection
  4. End With
  5.  

7 6354
ADezii
8,834 Expert 8TB
If you are asking how to Print the Current Record on a Form:
Expand|Select|Wrap|Line Numbers
  1. With DoCmd
  2.   .RunCommand acCmdSelectRecord
  3.   .PrintOut acSelection
  4. End With
  5.  
Nov 9 '11 #2
jawbone
14
thanks Adezii
that is what i want. so where do i include my form name and so on
Nov 9 '11 #3
ADezii
8,834 Expert 8TB
You do not need to include the Form Name, simply navigate to the appropriate Record then execute this Code. I would imagine that the best location for the Code would be in the Click() Event of a Command Button on your Form with a Caption similar to Print Current Record.
Nov 9 '11 #4
jawbone
14
That worked out perfect for my form, but maybe im not explaining the problem im having right. i want to add a button on my form that can access a report and print that report in a single form. filter that report so that it would only print the current record selected.
Nov 9 '11 #5
ADezii
8,834 Expert 8TB
You would use the Where Argument of the OpenReport() Method. assuming that I have an Employees Form, and that I wish to Print an Employees Report (rptEmployees) for the Current Record. As long as the [EmployeeID] Field exists on the Form, and as part of the RecordSource for the Report:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "rptEmployees", acViewNormal, , "[EmployeeID] = " & Me![EmployeeID]
Nov 10 '11 #6
jawbone
14
thanks Adezii it worked great
Dec 7 '11 #7
ADezii
8,834 Expert 8TB
@jawbone:
Glad it all worked out for you.
Dec 13 '11 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: sentinel | last post by:
Hi, Wonder if anyone can help with this problem: I am using an app with several pages, using a session to track vars between the pages, and using an image map to re-direct back and forwards...
4
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
1
by: mvr | last post by:
Hi all Is there any way I can print the current page(page1.asp) and another page(page2.asp) from the current page(page1.asp). Any code or suggestions will be appreciated. Thanks mvr
4
by: Penny | last post by:
Hi all, How can I retrieve the current page url(and parameters/arguments) using ASP code? The current page is an asp search results page so the url includes the page name and the...
7
by: Brian Henry | last post by:
Hi, I have a data grid that has the following properties EnableViewState = false AllowPaging = true AllowSorting = true AllowCustomPaging = false now, when the page switches I want to get...
4
by: antonyliu2002 | last post by:
I am new to the .NET framework. I know this has been discussed many times in this group. I also read extensively here, however, I am in bad luck: none of the sample code provided in this forum...
2
by: jon | last post by:
Hi This might be an easy one to answer but I have a web form in an ASP.NET 1.1 application with a hand-rolled HTML image button as follows which opens a help guide in a new window: <input...
1
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
1
by: bandy | last post by:
Hi there, I am quite confusing in getting page number for pagination links. See what I am doing:I have a ShowDetails.php page on which I have created page links in for loop. Onclick of every...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.