Results 1 to 11 of 11
  1. #1
    erickemboi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    73

    Export report as pdf

    I would like to code month and year and add to FileName = EIGHT (JANUARY 2020)


    HOW DO I ADD MONTH AND YEAR FUNCTION.
    HERE IS MY FULL CODE

    Function FileExist(FileFullPath As String) As Boolean
    Dim value As Boolean
    value = False
    If Dir(FileFullPath) <> "" Then
    value = True
    End If
    FileExist = value
    End Function

    Private Sub cmd_exportPDF_Click()

    Dim fileName As String, fldrPath As String, filePath As String
    Dim answer As Integer

    fileName = "EIGHT" 'filename for PDF file*
    THE FILE NAME IN PDF EXPORTS SHOULD BE UPDATED AUTOMATICALLY TO ( EIGHT JANUARY) without me typing the code manually to JANUARY

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    I don't understand. If you want "EIGHT JANUARY" in file name then use that. If you want to extract month and year from current date, use Format() function.

    You don't show export command code.
    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
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    format([dateFld,"d, mmmm YYYY")

  4. #4
    erickemboi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    73
    Function FileExist(FileFullPath As String) As Boolean
    Dim value As Boolean
    value = False
    If Dir(FileFullPath) <> "" Then
    value = True
    End If
    FileExist = value
    End Function

    Private Sub cmd_exportPDF_Click()

    Dim fileName As String, fldrPath As String, filePath As String
    Dim answer As Integer

    fileName = "EIGHT" 'filename for PDF file*
    fldrPath = "C:\Users\Jessica\Desktop\PDF Exports" 'folder path where pdf file will be saved *

  5. #5
    erickemboi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    73
    I want the file name to updated to the system month and year without me typing e.g EIGHT SEPTEMBER 2020 without me not typing (SEPTEMBER 2020)

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,860
    You need some way of converting 19 to NINETEEN?, perhaps a table would be the easiest?

    So DLookUp() the day number in that table for the word version.
    Get month and year words with format(date,"mmmm yyyy") and then concatenate them altogether with &

    HTH

  7. #7
    erickemboi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    73
    Thanks so much. You are genius.

  8. #8
    erickemboi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    73
    Thanks everyone for your assistance. I appreciate this forum. Good work!

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Keep in mind, you created thread in Forum Suggestions. Next time pick appropriate topic subforum.
    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
    erickemboi is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2020
    Posts
    73
    How do I pick topic subforum?
    I want to ask a question?
    Are you able to use ms access vba to code access to automatically detect a computer for example *c:users\(name of the computer eg. ERICK\PDF EXPORTS\FILE NAME???

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    You pick a topic forum the same way you picked Forum Suggestions but under the Access Forums group instead of Community.

    Can use Environ() function to retrieve systems properties.
    Environ("USERNAME")
    Environ("COMPUTERNAME")

    Or Shell commands. Let you research that.
    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.

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

Similar Threads

  1. Export report
    By slimjen in forum Reports
    Replies: 2
    Last Post: 07-19-2019, 07:12 AM
  2. Export Report To PDF
    By ekoziko in forum Access
    Replies: 8
    Last Post: 04-06-2018, 02:16 PM
  3. Export Report to PDF
    By Ganymede in forum Import/Export Data
    Replies: 2
    Last Post: 03-16-2016, 08:55 AM
  4. Export Report to PDF
    By cuddles in forum Reports
    Replies: 10
    Last Post: 05-21-2014, 09:28 AM
  5. Export report to jpg
    By isdm in forum Reports
    Replies: 1
    Last Post: 04-16-2010, 10:00 PM

Tags for this Thread

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