Results 1 to 10 of 10
  1. #1
    Join Date
    May 2013
    Location
    Baltimore Maryland
    Posts
    15

    HELP With printing!!

    I have a form with a subform on it.




    i have a query setup. At the bottom on that query, in the criteria section, i have have set up a filter. The values are entered on the main form from a combo box and then the results are displayed in the subform.


    I just need option to print the results that show up in the subform or create a report that can be printed.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    1. One method is parameterized query, review: http://datapigtechnologies.com/flash...mtoreport.html

    2. Another is the WHERE CONDITION of DoCmd.OpenReport, example:
    DoCmd.OpenReport "report name", , , "ID=" & Me.comboboxname

    Why do you have a main/subform arrangement? Is the subform linked to recordset of the main form? If not, can just be a single form. Use Continuous view to arrange controls like Datasheet and put command button in form header.
    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.

  3. #3
    Join Date
    May 2013
    Location
    Baltimore Maryland
    Posts
    15
    Quote Originally Posted by June7 View Post
    1. One method is parameterized query, review: http://datapigtechnologies.com/flash...mtoreport.html

    2. Another is the WHERE CONDITION of DoCmd.OpenReport, example:
    DoCmd.OpenReport "report name", , , "ID=" & Me.comboboxname

    Why do you have a main/subform arrangement? Is the subform linked to recordset of the main form? If not, can just be a single form. Use Continuous view to arrange controls like Datasheet and put command button in form header.

    I have arrangement because it easier for the user i think to just see the results to just see the results on the same page. Maybe im missing the point using a single form with continuous view.

    I will try the the second option and let you know how it goes. Thank you!

  4. #4
    Join Date
    May 2013
    Location
    Baltimore Maryland
    Posts
    15
    Quote Originally Posted by June7 View Post
    1. One method is parameterized query, review: http://datapigtechnologies.com/flash...mtoreport.html

    2. Another is the WHERE CONDITION of DoCmd.OpenReport, example:
    DoCmd.OpenReport "report name", , , "ID=" & Me.comboboxname

    Why do you have a main/subform arrangement? Is the subform linked to recordset of the main form? If not, can just be a single form. Use Continuous view to arrange controls like Datasheet and put command button in form header.

    What would i enter for ID=?

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    ID would be your field name. In case the data type isn't numeric:

    http://www.baldyweb.com/wherecondition.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Join Date
    May 2013
    Location
    Baltimore Maryland
    Posts
    15
    Quote Originally Posted by pbaldy View Post
    ID would be your field name. In case the data type isn't numeric:

    http://www.baldyweb.com/wherecondition.htm

    DoCmd.OpenReport "pcxloc", , , "OfficalName=#" & Me.lcsrch & "#"

    This what i have as my click code and ill show you there error i get:

    Click image for larger version. 

Name:	untitled.GIF 
Views:	14 
Size:	84.0 KB 
ID:	12349

  7. #7
    Join Date
    May 2013
    Location
    Baltimore Maryland
    Posts
    15
    the code is behind the command27 button. the location dropdown is Me.lcsrch

    SO CLOSE I THINK!!

  8. #8
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    DoCmd.OpenReport "pcxloc", , , "OfficalName=#" & Me.lcsrch & "#"
    I don't understand the WHERE portion of your code.

    Why are you using the "#"?

    It appears you are tying to call lcsrch a date. Is it?


    Dale

  9. #9
    Join Date
    May 2013
    Location
    Baltimore Maryland
    Posts
    15
    yaeee!! LOL it works. thank you!!



  10. #10
    Join Date
    May 2013
    Location
    Baltimore Maryland
    Posts
    15
    i changed it from # to '

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

Similar Threads

  1. Pictures not printing
    By Curtis1000 in forum Reports
    Replies: 7
    Last Post: 09-28-2011, 08:23 PM
  2. Printing
    By mrkaye in forum Reports
    Replies: 12
    Last Post: 09-11-2011, 07:20 PM
  3. Printing from a Macros
    By Kenneth in forum Access
    Replies: 1
    Last Post: 07-05-2011, 02:02 PM
  4. Printing!!!!
    By Kipster1203 in forum Access
    Replies: 7
    Last Post: 05-14-2010, 08:58 AM
  5. Help with my printing
    By mattwill2001 in forum Queries
    Replies: 4
    Last Post: 08-17-2009, 01:55 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