Viewing one record at a time (1 Viewer)

mcampan

New member
Local time
Today, 13:11
Joined
May 1, 2021
Messages
3
Hello,
I am very new to access and thought i was starting to understand it but am stuck on something. I built a report and am trying to be able to pick the record i view and print. I do not want to print all the records. I had a macro that i used to do this that worked until i made some changes and now i cannot figure out how i did it. I am pulling the data for the report from two different tables. The previous macro would would have a Enter Parameter Value box pop up and i would put in the ID number that i was looking for and the report would pop up for just that ID number. Thank you in advance for any help!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 10:11
Joined
Aug 30, 2003
Messages
36,125
Perhaps you used the wherecondition argument?


Most of us would use a form to gather user input rather than the Enter Parameter Value box, as you have more control.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:11
Joined
Oct 29, 2018
Messages
21,467
Hi. Welcome to AWF!

Can you show us your macro? Thanks.
 

onur_can

Active member
Local time
Today, 10:11
Joined
Oct 4, 2015
Messages
180
Hello there
The simplest way to do this is to replace the record source of your report with a query that covers all fields in your table. This is to write [Enter ID] in the ID field criteria part of the query. In this way, when the report is opened, a parameter screen will appear that allows you to select the record.
 

mcampan

New member
Local time
Today, 13:11
Joined
May 1, 2021
Messages
3
The macro i was using is this: [2021Events]![id]=[Forms]![EventsForm]![id] . I have since learned how i should be naming things to make more sense. the 2021Events should be tbl2021Events and EventsForm frmEventsForm.
I will try the other suggestions on here. Thank you everyone for the help so far and i will report back.
Mike
 

mcampan

New member
Local time
Today, 13:11
Joined
May 1, 2021
Messages
3
It appears that Onur_Can's soultion worked! Thank you all for the help!!
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 13:11
Joined
Feb 19, 2002
Messages
43,257
You will find that using a parameter is annoying. Best is to use a form to run reports and have an unbound control on the form to use to select the record you want to include on the report. Doing it this way gives you other options such as using DoCmd.OpenReport and providing a where argument to select just one record or having a different option that has no filter so all options are selected. You can even have an option group on the form that lets the user select between preview, print, pdf, Excel so you have an easy way to give the user options.
 

Users who are viewing this thread

Top Bottom