Filter Form to only print selected record from button?

Fool_Working

New Member
Joined
Mar 23, 2006
Messages
31
I am making a questionaire form form for my company. Most of the people using the form are clueless about access.

The people filling out the questionaire want to be able to print out their answers after submitting, however the questionaire is to complicated to send to a report. I noticed you can print right from the form page, but when you hit print it tries to print every record in the set, instead of just the selected record unless you filter on the questionaire number.

I made a print button, but I am trying to auto filter the results to just print the selected questionaire when hit. However, I can't get the the filter code to work.

Here is my current code. When run I get the error: 'Applyfilter Action was canceled'

Code:
surveyID = Me.txtSurveyID.Value
  
    'set focus on form and then filter to selected survey
    With Forms!frmUserEditSurvey
        .SetFocus
        DoCmd.ApplyFilter , "pksurveyID = '" & surveyID & "'"

    End With

I've searched all through the archives here and through the microsoft help menu, but I still haven't been able to get this to work. Is this even possible?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,452
Office Version
  1. 365
  2. 2021
  3. 2016
Platform
  1. Windows
Hi

Why do you think the information is too complicated to be used in a report? If you can present the data in a form then you should be able to do it in a report.

Andrew
 
Upvote 0

richard3x3

New Member
Joined
May 30, 2007
Messages
11
print form

Here is what i usully do.

1 convert the form to a report,
2 make a parameter query relating the form for the report
3 have a a button labled "print this form" open the the report


Hop this helps.
 
Upvote 0

Forum statistics

Threads
1,191,719
Messages
5,988,298
Members
440,148
Latest member
sandy123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top