Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 108591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:56:09+00:00 2026-05-11T01:56:09+00:00

I have an access 2007 Database that outputs a report in excel format, the

  • 0

I have an access 2007 Database that outputs a report in excel format, the report is dependent on a date parameter that is chosen by the user. This parameter is selected via a textbox (text100) that has a pop up calendar. I would like to use the date in the text box(text100) as part of the filename. I am using the transferspreadsheet method to create the export, However I do not need the column headers. Once the file is created I have the code open the file and delete the headers. Also the current code is using todays date in the filename which is not accurate. The filename needs to reflect the date that was selected by the user in the text box from the pop up calendar

Ok here is the code.

Sub Branch298nohdr()    Dim Filename As String  Dim Path As String  Dim Branch As Integer  Dim Text100 As Date  Dim xl       Branch = '298'     Path = 'Path' & Branch & '\'     Filename = 'Identity Report ' & Branch & ' ' & _                         Replace(Text100, ':', ' ') & '.xls'    If Dir(Path & Filename) <> '' Then      MsgBox 'File has been created already'  If Dir(Path & Filename) <> '' Then      GoTo 53  End If  Else       Set xl = CreateObject('excel.application')       TempVars.Add 'branchnum', Branch         DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, _             'queryname', Path & Filename, False     xl.workbooks.Open Path & Filename       With xl            .Rows('1:1').entirerow.Delete             .Columns('L:L').select             .Selection.NumberFormat = '0'           .range('a1').select             xl.workbooks(1).Close Savechanges:=True              xl.Quit     Set xl = Nothing 53     MsgBox 'Done!'     End With      TempVars.Remove 'branchnum' End If  Branch298nohdr_Exit:     Exit Sub    End Sub 

Text 100 is where the user selects a date via a pop up calendar. I would like to use this date as part of the file name. Currently using the text100 as part of the filename it is being referenced as 12:00 am, and then adds this to the file name. I hope this clears up my intention.

Text 100 gets set on the opening form then there are several buttons which allow the user to pick between several branches or all branches.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:56:10+00:00Added an answer on May 11, 2026 at 1:56 am

    Well the obvious question is, where does Text100 get first set?

    Another style comment, it is better to do

    goto ExitSub '... ExitSub:  

    Then your ‘GoTo 53’ – its a little more meaningful.

    At that rate, it would be better to move your ‘Done’ message outside of the IF statements, and the TempVars doesn’t seem to have a purpose; remove it.

    Edit:

    I presume if Text100 is a textbox on the form, then the line that reads:

    Dim Text100 As Date 

    is going to override that reference in your code.

    If you are referencing that textbox in your code, you need to do it this way:

    foo = me.Text100 ' or foo = Forms!FormName.Text100 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 140k
  • Answers 141k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer "The problem with that solution is that with so many… May 12, 2026 at 8:00 am
  • Editorial Team
    Editorial Team added an answer The implementation dannyasher posted is a non-tail-recursive one. In order… May 12, 2026 at 8:00 am
  • Editorial Team
    Editorial Team added an answer DDD is really just an elaboration of the design pattern… May 12, 2026 at 8:00 am

Related Questions

I have an Access 2007 database that works asynchronously with a MAS200 database. Due
I have an Access 2002 application which links an Oracle table via ODBC with
I'm interested to know how I could improve the performance of SQL Server when
I am working on a new application that uses a jet (MS Access) database.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.