Solved

Comand Buttions: Print Report options

Posted on 2008-06-13
6
202 Views
Last Modified: 2013-11-28
I have a form inappropriately (I will change it) named: tbl_ComputerName1, I have a command button on it called: Print Microsoft Report, I want this button to print just the record that is on the page being viewed at present but it tries to print all the records. I also want to put another command button that will also print all the other records associated just with the one record (the other pages: tbl_ComputerName2, 3 ect.) being viewed from this page. I know this is a coding issue but I dont know how to start on this project
AssetTrack.mdb
0
Comment
Question by:James Coats
6 Comments
 
LVL 6

Expert Comment

by:lorenda
ID: 21781484
Can you show me the Query that your report is based on? You should be able to base your report on a query that pulls only the record shown on your form (assuming you have a primary key on your form somewhere).
0
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 21781528
Without looking at your attachment (sorry, personal rule) your command button should reference the primary key of the record currently active, and use the Filter parameter to filter (using the WHERE clause would work too) the report:

DoCmd.OpenReport "Your Report Name", acViewPreview, "[SomeIDValue]=" & Me.SomeIDValue
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 21781971
SamuelClemmons,

Jim is correct.
Please get this part working first, and report back with the results

Then we can work on the "Other" button.

JeffCoachman
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:James Coats
ID: 21783181
Here is the code of my command button, how would you change to code to see an ID value? I do have PK with the tables.
Private Sub CommandMicrosoftSoftware_Click()
On Error GoTo Err_CommandMicrosoftSoftware_Click
 
    Dim stDocName As String
 
    stDocName = "rpt_MS_Software"
    DoCmd.OpenReport stDocName, acNormal
 
Exit_CommandMicrosoftSoftware_Click:
    Exit Sub
 
Err_CommandMicrosoftSoftware_Click:
    MsgBox Err.Description
    Resume Exit_CommandMicrosoftSoftware_Click
    
End Sub

Open in new window

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 21786804
SamuelClemmons,

Like I said, let's get the Report/Form Record synchronization working *first*, before anything else.

So, please apply jimhorn suggestion and get the crorrect data in the report working *first*.

Bedsides, with the correct record displayed on the report, I don't really see a need to "see an ID value"

JeffCoachman
0
 

Author Closing Comment

by:James Coats
ID: 31467024
Jim you got me started with the code sample on the ID. I solved the rest of it over the weekend
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question