James Coats
asked on
Comand Buttions: Print Report options
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
AssetTrack.mdb
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).
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
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
Jim is correct.
Please get this part working first, and report back with the results
Then we can work on the "Other" button.
JeffCoachman
ASKER
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
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
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
ASKER
Jim you got me started with the code sample on the ID. I solved the rest of it over the weekend