Results 1 to 11 of 11
  1. #1
    Nofri is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    7

    Post How To Print Selected Records on Form?

    I have Form which is result of query,
    query result consist only name and namecode

    what i want to do is :
    i want to print report by selected box from name
    for example if query result :

    Name Name Code Checkbox
    Asep ASP
    Galang GLG


    Rian RN

    then i choose Asep & Galang by checkbox (this checkbox will be not recorded to table)

    after that i push button to print report, then it will be display report with those selected box

    How to solved this?

  2. #2
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Welcome to the forum.

    It would be easiest if you would post a copy of your dB. I don't understand how you can select record to be printed if you have an unbound Checkbox on the form.

    Just need a few records to be able to test printing.

  3. #3
    Nofri is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    7
    Click image for larger version. 

Name:	Capture  1.PNG 
Views:	22 
Size:	37.3 KB 
ID:	44344

    this is the picture that i means

    this is the result of query on forms, then on form i add checkbox (label name checkbox19)
    then when this checkbos is checked

    it wil be printout the record
    now, the condition when i checkbox 1 record, all record suddenly become checked
    so i cant print specific record

    Click image for larger version. 

Name:	Capture3 .PNG 
Views:	20 
Size:	70.7 KB 
ID:	44345

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    If the checkbox is not part of the form's record source you cannot do that. You can use a multiselect listbox instead to select your records for printing or you can use a temporary table which you would populate with the names (or better NameID if you have one) and that table would have a IsSelected Yes\No field (bound to your checkbox on the form) to allow you slect the records you want for printing.
    EDIT: just saw your latest post; that is why it cannot be done as you intend. Any unbound control on a continuous form will show the same value for all records.
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    So to use your example, you need to create a local table (hopefully you have a split db with each user having their own front-end) with two fields:BudgetCode(Short Text\PK) and IsSelected (yes\No). You need to empty the table ("Delete * from tempBudgetCode;") then populate it with your selection (record source of your form) before you open the form. Change the form's recordsource to join in this new table and bind your Check 19 checkbox to IsSelected. If the Budget Code fields are indexed in both tables the query should be editable so you should be able to select individual records for printing\whatever else.
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    Nofri is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    7
    how to insert temprary table to this query ??

    this temporary will be insert to query right? then we should give Criteria True / Yes
    Click image for larger version. 

Name:	Capture4.PNG 
Views:	21 
Size:	37.8 KB 
ID:	44346

  7. #7
    Nofri is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    7
    i understand about make new table
    but others step i confused, sorry im still in learning access

    could you help by make same db?

  8. #8
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    "Name" is a reserved word in Access and shouldn't be used for object names.
    You have spaces in object names ("Budget Code") - shouldn't use spaces in object names.

    The images you posted are of no help. You should really post your dB. I would use a form to select the records you want to print. Then open the report with the query as the report record source. Without seeing your dB, I cannot give you a focused response.

    Good luck with your project......

  9. #9
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209
    Quote Originally Posted by ssanfu View Post
    "Name" is a reserved word in Access and shouldn't be used for object names.
    You have spaces in object names ("Budget Code") - shouldn't use spaces in object names.

    The images you posted are of no help. You should really post your dB. I would use a form to select the records you want to print. Then open the report with the query as the report record source. Without seeing your dB, I cannot give you a focused response.

    Good luck with your project......
    As suggested by Gicu create a separate temporary table with a checkbox to mark the items in the temporary table for selection of items for the Report. The check-marked items can be selected in the criteria section of the Report Query as a sub-Query to pick the items to match with the Report Table/Query items with the IN Clause in the Query. For more details visit the following Link:
    https://www.msaccesstips.com/2011/01...pressions.html

  10. #10
    Nofri is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    7
    Thankyou for your advise but i'm sorry i'm beginner, i just learn DB Access 1 week ago
    it is still not understand how to make code like that query and combine those temporary table

    if you can make a sample video i appreciate to you ... upload to youtube maybe
    Please .

  11. #11
    CarlettoFed is online now Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    255
    If you attach a sample file, replacing any sensitive data, it would be easier to help you.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Print only selected records
    By shod90 in forum Forms
    Replies: 7
    Last Post: 04-23-2019, 11:09 AM
  2. How to print selected records of a Report
    By Fyeung in forum Reports
    Replies: 3
    Last Post: 02-16-2015, 07:43 PM
  3. Print only selected record of a sub form
    By falahsalih in forum Access
    Replies: 10
    Last Post: 05-11-2014, 09:28 AM
  4. Replies: 2
    Last Post: 09-18-2010, 07:52 AM
  5. Replies: 7
    Last Post: 02-25-2010, 12:32 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums