Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727

    Print preview button in form


    I have a form that has a print preview button. This form is linked to a query that has a prompt that pops up to enter criteria before it runs. So when the form opens it has this criteria prompt that pops up. You enter a start date and an end date then the form opens. So then if I click the print preview button it will prompt again for the criteria. Is there a way to stop this? The form is a split form with the button on the form on top with the button on it and below it is the datasheet half. If I can't stop the prompt when clicking the print preview button, can I fix the cancel part of it? Meaning if I click cancel for the print preview prompt for criteria it has a macro error.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    When you create parameterized queries or reference forms/controls in expressions you limit the functionality of your saved query object. Perhaps you can right click copy/paste your named query object, remove the parameters, and use the new query object for the recordsource of your report.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Don't use dynamic parameter input popups (I NEVER do). Use an unbound control on form to enter criteria. Query can refer to the control as parameter. Or use VBA to construct criteria string and set form Filter property.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    That sounds like a good idea. How do I set that up? I know how to get an unbound control field on a form but what do I do after that?

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    I'm interested in doing the unbound control field to run a search but the clip you provided would not be practical since I have over 11,000 records. I don't want to go through all that in a drop down combo box. I'm pretty happy with the criteria prompt that I get before opening the form/query, its just that I don't want it to ask me again for the criteria I just typed in whenever I click the print preview button. Not to mention if I click cancel to stop the print preview from opening, I get a macro error and the whole database just exits.

    In a split form with form on top and datasheet on bottom, how do you get the buttons or controls I create on the top in the form section to work for the datasheet in the bottom? Like could I make a text box in the top/form section, that I type in criteria to do a search below in the datasheet section? Also, I made a print button on the top in the form section, hoping that it would print the datasheet below but it only printed the form section. How do I link it together?

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Doesn't have to be a combobox. Can be a textbox. Combobox just helps reduce the user frustration from typing invalid criteria.

    I NEVER use dynamic parameter input prompts in queries. Can't validate user input and then there's the issue you describe.

    I don't use split form. However, I think the filter criteria affects both sections. It is just one RecordSource for the form.

    Never tried printing a split form. Forms aren't really intended to be printed, that's what reports are for. Sounds like the split form isn't going to be cooperative for what you want. I have made a normal form serve as a print object for single record. However, for lists I recommend a report.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    So if I setup a textbox in the split form then change the filter criteria for the textbox, it might work for the split form/datasheet? I'll try messing with it and let you know.

    I guess I'll have to make a report based from a query to a split form for viewing, then finally to a report. Maybe that might work? I liked reports until I found out how little you could do with them beside printing it.

    Thanks.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I have seen developers use report in Report View as an interactive GUI. Click events will work and criteria can be applied to report Filter property and the report refreshed. Print Preview is another matter, really just for printing.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    The way I want this to work is I want to be able to enter a start date and an end date then it searches for all the records between those dates. Is that possible with a textbox? I probably need two textboxs. One for start and one for end dates.

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Yes, textboxes can be used.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    What if I did this instead? Make a form bound to the query with the criteria expression that I put in to prompt the user, removed. Then I make this new form a continuous one and set it up to show multiple records sort of like a datasheet view and put the textboxes at the top in either detail header or form header so as you scroll through all the records the search boxes can stay at the top if you want to change the filter/criteria while being in the form. Does this sound logical?

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Yes, I think that is essentially what is described in the referenced links.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #14
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    I got my unbound text box and button right next to it. How do I link the two? Which property do I have to make changes to?

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    What is not clear about either of the referenced links? Have you followed the instructions they give? Which method do you want to use?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Print Preview Command Button Locks Access
    By DanKoz in forum Access
    Replies: 7
    Last Post: 03-19-2018, 12:34 PM
  2. Print Preview Button
    By data808 in forum Forms
    Replies: 2
    Last Post: 01-15-2014, 11:34 AM
  3. Print Preview Button
    By LukeJ Innov in forum Programming
    Replies: 3
    Last Post: 08-22-2013, 03:44 AM
  4. Preview print on form ???
    By rfhall50 in forum Forms
    Replies: 0
    Last Post: 03-28-2011, 10:16 AM

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