Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    Moorpark, CA
    Posts
    104

    Cool Unanswered: Question about Yes/No

    Hello All -

    I'm still learning, so this may be a dumb question....LOL

    I have a query that selects records from my tables based on a certain criteria with a parameter set up to request the date. This narrows down my results even further. Throughout the day I will open a form that contains the information from the narrowed down query and print off the forms. The problem is that I will have printed a couple of the records earlier in the day and I do not want to print them again. My current method is a yes/no box that I select the ones I want to print, filter down the form and then print. Is there an easier way to select records from a Query to filter in to a form? Or if not, is there a way for me to use the yes/no box to select the records to print, but then once they print, deselect the box automatically?

    Any suggestions? Any would be welcome! =)

  2. #2
    Join Date
    Dec 2004
    Posts
    10
    How do you print the reports ? Do you use a command button ? If not you could use a print button and assign it to mark the yes/no automatically and then based on the date/time field. ie. if a report time was older thatn 24hrs from the current time then it would clear all yes/no fields and set them back to no. Hope this helps an if it is too confusing send me an email and we can work through it. mike.taylor@cox.net


    Quote Originally Posted by Jennay
    Hello All -

    I'm still learning, so this may be a dumb question....LOL

    I have a query that selects records from my tables based on a certain criteria with a parameter set up to request the date. This narrows down my results even further. Throughout the day I will open a form that contains the information from the narrowed down query and print off the forms. The problem is that I will have printed a couple of the records earlier in the day and I do not want to print them again. My current method is a yes/no box that I select the ones I want to print, filter down the form and then print. Is there an easier way to select records from a Query to filter in to a form? Or if not, is there a way for me to use the yes/no box to select the records to print, but then once they print, deselect the box automatically?

    Any suggestions? Any would be welcome! =)

  3. #3
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    Quote Originally Posted by Jennay
    Hello All -

    I'm still learning, so this may be a dumb question....LOL
    Hello Jennay and Happy New Year to you...

    Firstly, understand this what I was told...the ONLY dumb question is the one you DON'T ask. Hey, you never know until you ask.

    Now, for the matter at hand, there are several ways to get at your particular problem, as is with anything in this world of designing databases and such. In one of my databases I have on the form a CheckBox that will bring up the Report to be printed. I then print it, if it looks ok, and when I come back to the form afterwards, the CheckBox is cleared automatically. Here is how I did it:

    Code:
    Private Sub Print_Click()
    'Created by BUD 1-29-2004.
    'Checking the box sends current record to the report for viewing and printing.
        
       DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
       DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
       Dim stDocName As String
    If [Print] = -1 Then       'selects ONLY those CheckBoxes that are selected.
        stDocName = "rptMeeting1"
        DoCmd.OpenReport stDocName, acPreview
    End If
        
    End Sub
    Then after the Report closes I have it to run the UpdateQuery to Deselect that CheckBox without any user intervention. And it goes like this:
    Code:
         Private Sub Report_Close()
    
        CurrentDB.Execute "udqryDeselectPrint"   'this runs the UpdateQuery.
        End Sub
    Now, in another program I created, in the DataSheet SubForm I have CheckBoxes that say:PRINT and then coded the Print CommandButton on the Main form to select the fields with the CheckBox selected, pull them into the Report, print automatically without viewing and stopping there. Then, IF I want to do so later I have a CommandButton to Clear all the CheckBoxes that are selected (known as the PrintQueue). But that was an option my company wanted to be there, but hey, they wanted it and it works well. So, there you have two more options to check out. Hope this helps you out some.

    have a Happy and Wonderful New Year!!!!!!!!!!!!!!!
    BUD

    Just a note for further info....the line that says CurrentDB.Execute simply cancels out the warning messages that you are about to run the associated UpdateQuery then turns them back on. Just so ya know

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •