Help and Support
 

powered byLive Search

ACC: How to Print Randomly Selected Records

Retired KB ArticleThis article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Article ID:187899
Last Review:January 23, 2007
Revision:3.1
This article was previously published under Q187899
Novice: Requires knowledge of the user interface on single-user computers.
On This Page

SUMMARY

This article describes a method that you can use to print records that are randomly selected.

Back to the top

MORE INFORMATION

There may be occasions where you need to print a selection of records that do not have a common criteria. For example, you may need to send an acknowledgment to each customer who responded to a survey, but you do not want to keep a permanent record of these responses. To do this, you need to add a Yes/No field to a table, add a check box to a form, and build two new queries. The first query will be a select query that you will use as the record source for the report; the second query will be an update query that you will use to reset the Yes/No field. This example uses the sample database Northwind.mdb.

Back to the top

Add a Yes/No Field to the Table

1.Open the sample database Northwind.mdb.
2.Select the Customers table, and click Copy on the Edit menu.
3.On the Edit menu, click Paste.
4.In the Table Name text box of the Paste Table As dialog box, type tblExample.
5.Under Paste Options, select Structure And Data, and then click OK.
6.Open the tblExample table in Design view and add the following field:
      Table: tblExample
      -----------------
      Field Name: ysnPrint
         Data Type: Yes/No
         Required: No
         Indexed: No
					
7.Save the changes and close the table.

Back to the top

Add a Check Box to a Form

1.Make a copy of the Customers form as frmExample.
2.Open the frmExample form in Design view.
3.In the Properties dialog box, change the form's Caption and RecordSource properties as follows:
      Form: frmExample
      -------------------------
      Caption: Print
      RecordSource: tblExample
					
4.Add the following check box to the form:
      Check box:
      --------------------------
         Name: chkPrint
         ControlSource: ysnPrint
					
5.Change the Caption property of the adjacent label to:
      Label:
      ------------------------
         Name: lblPrint
         Caption: Print Record
					
6.Save the changes and close the form.

Back to the top

Build the Query for the Report's Record Source

1.Build the following query:
      Query: qryExample
      --------------------
      Type: Select Query

      Field: tblExample.*
         Table: tblExample

      Field: ysnPrint
         Table: tblExample
         Show: No
         Criteria: Yes
					
2.Make a copy of the Customer Labels report as rptExample.
3.Open the rptExample report in Design view.
4.Change the RecordSource property of the report to:
      qryExample
					
5.Save the changes and close the report.

Back to the top

Build the Update Query that Resets the Yes/No Field

1.Build the following query:
      Query: updExample
      --------------------
      Type: Update Query

      Field: ysnPrint
         Table: tblExample
         Update To: No
         Criteria: Yes
					
2.Save the changes and close the query.

Back to the top

Test the Example

1.Open the frmExample form in Form view.
2.Move through the records and, at random, click to select the Print Record check box for a number of records and make a note of those selected.
3.Close the form and open the rptExample report in Print Preview.
4.You should see a mailing label for each of the customers that you selected in Step 2.
5.Close the report and run the updExample query.
6.Open the frmExample form in Form view and move to each record that you had previously selected in Step 2. Note that the Print Record check box is no longer selected.

Back to the top

REFERENCES

For more information about update queries, search the Help Index for "update queries, creating," or ask the Microsoft Access 97 Office Assistant.

For more information about creating check boxes, search the Help Index for "check boxes, creating," or ask the Microsoft Access 97 Office Assistant.

Back to the top


APPLIES TO
Microsoft Access 95 Standard Edition
Microsoft Access 97 Standard Edition

Back to the top

Keywords: 
kbhowto KB187899

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by E-mail, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.