Results 1 to 7 of 7
  1. #1
    hlbly1969 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    7

    Report From Desktop

    Hi All ,


    I have zero experience with MS Access and trying to create forms and reports.
    I Have a need to generate a report by double clicking on an icon from the desktop which will then generate a report. The Only input necessary would be an expiration date.
    The report would then need generate a unique (Auto incrementing ID) along with the date that was input and a couple of static text fields that would never change.

    As soon as the date is input the report would then print to a label printer then close out.
    Is this possible?

    So basic steps would be
    1 - open report in access
    2 - Input Expiration Date
    3 - Print Form
    4 - Close report (access)


    Any help or suggestions is much appreciated.
    Thanks
    Attached Thumbnails Attached Thumbnails Control Number.jpg  

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    create your report.
    have it bound to a table that has an AUTONUM field, Date Field.

    make a form that connects to this table, set property to DATA ENTRY = TRUE

    make a macro AUTOEXEC to open the form when the app starts
    then when the form opens, it will have empty fields: autonum & date , for the user to enter the date.
    user enters the date, clicks the Report button on the form
    the Report button will :
    1. save the record, to get the autonum

    2. open the report (to screen or to printer). Docmd.OpenReport "rMyReport"
    the rpt uses a query that reads the autonum on the form
    ex: select * from table where [id]=forms!fMyForm!txtID

    3. after it prints, close the app

  3. #3
    hlbly1969 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    7
    Thanks Ranman256
    I will try this and see if I can get it to work.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    You can open the report direct from the desktop using a shortcut.
    To do so, select the report in the navigation pane and drag it to your desktop.
    A shortcut is created. When you double click the shortcut, your database will open directly to that report,

    BTW the same method can be used for any Access object: table/query/form/report/macro/module
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    hlbly1969 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    7
    I was able to get the report that I needed to populate with the correct expiration date and open up the print dialogue box.

    However is there a way to skip the print dialogue box so that the report automatically prints to the correct printer without the user selecting the printer desired?
    The report does automatically select the dymo label printer in the print dialogue. The user at this point just needs to select "ok"

    Click image for larger version. 

Name:	Dymo_Select.jpg 
Views:	16 
Size:	40.2 KB 
ID:	41637

    Also After selecting ok and the report prints is there a way to automatically close the database out?

    Thanks for your help so far it been very helpful.

  6. #6
    hlbly1969 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    7
    Just a little update and a follow on question.
    I was able to get the report the way I would like for it to work. I click on a shortcut from the desktop the form pops up I put in a date the form closes pops open the print select dialogue I hit ok the report prints out the label then closes the database out.

    The follow on question.
    I have forgot in my initial design that every once in a while I will need to print out a label with the concurrent control number but the date field needs to say "None" for no shelf life.
    In my form I have some code that will automatically increment the control number by one number based off the last stored control number.

    Private Sub Exp_Date_BeforeUpdate(Cancel As Integer)
    Me.Ctrl_Nmbr = Nz(DMax("Ctrl_Nmbr", "Ctrl_Nmbrs"), 0) + 1
    End Sub

    The table (Ctrl_Nmbrs) im using to store this information has 3 fields, Entry_Date field (populated by the now() function for when the label is generated), Ctrl_Nmbr field populated by the code mentioned above from the form (Ctrl_Nmbr) and Exp_Date which is a date field manually input from the end user printing the desired label.

    On the report is it possible to have a label display "None" when no date is entered and have the report record a date like the Now() function into the table Ctrl_Nmbrs into Exp_Date field?


  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    You can change the label's caption in the Format event of the report section or simply change the label into a textbox and use its control source = NZ([YourDate],"None").

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. VBA To Save To Desktop
    By jo15765 in forum Programming
    Replies: 3
    Last Post: 05-15-2017, 12:16 PM
  2. Saving an Access Report, as a PDF, to my desktop
    By ecalvert47462 in forum Reports
    Replies: 3
    Last Post: 12-15-2014, 07:15 PM
  3. Replies: 1
    Last Post: 11-05-2014, 05:35 PM
  4. Replies: 4
    Last Post: 08-21-2013, 07:08 AM
  5. Replies: 2
    Last Post: 09-29-2009, 10:25 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