Saving A Named File

Nov 7, 2006

what is the correct syntax to string in a variable date?

here is my current coding

[CODE]

Set rsDate = CurrentDb.OpenRecordset("qry_Actual_Costs_Thru")

strSOPCDate = rsDate.Fields("Fiscal Week")

'need to string the file name with the date

ActiveWorkbook.SaveAs Filename:= _
"C:my folder locationCombined SOPC THIS IS WHERE I NEED THE strSOPCDate.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

CODE]

my overall goal is to save a weekly file named "Combined SOPC m/dd/yy" where the m/dd/yy is being pull form strSOPC Date whick pulls from my qry.

thanks
Tuk

View Replies


ADVERTISEMENT

Saving An MDB File As MDE

Nov 28, 2006

I seem to be having problems saving my database files (.MDB) as .MDE files.

I have a database that only contains data (tables).

A second database is used as the interface to this data (it contains forms, reports, and uses linked tables to the data database).

This secong database file is then copied and used my a few users, so that everyone is accessing the same set of data.

I am trying to save the second database as an .MDE file, but under the Tools, Database Utilities option... 'save Database as an MDE' is never highlighted as a viable option. Is there some trick (or conditions) to enable this option?

I am basically doing this so that I can distribute the MDE version of the interface so that users will have limited / no access to be able to modify the code (or get into the table?).

Thank you for any advice or directions you may be able to pass on.

-arm1

View 4 Replies View Related

Saving New Fonts In The MDB File..

Aug 23, 2005

Hi,

I've recently started working on a new database and already have most of my forms, queries and reports ready. However, I've been using a special font that is not available on most PCs. I was wondering whether it was possible to save the font inside the MDB file so that it can be viewed properly on other systems as well ? (Sort of like in Powerpoint).

Another thing (I guess it's impossible but I'll ask anyway) : Is it possible to save the whole Windows Style design (Scroll Bars, Arrows, Icons, Menu colors, etc..) in my database file ?


Thanks for your help,

Daniel.

View 1 Replies View Related

Automatically Saving A Report As An Excel File

Jul 7, 2006

Hi,
I was wondering if there was a way for a report to be automatically saved as an excel file. Also, the Access database is stored on the company's server so would you be able to choose the path where the excel file would be stored?

Cheers,
Ben

View 1 Replies View Related

Suppress Warnings When Saving Text File?

Oct 12, 2004

How can I suppress the warnings that Excel displays when saving the text file?

These are the messages displayed when saving the file as text:

"The file already exists. Do you want to replace the existing file?" RESPONSE: Yes

"myfile.xls may contain features not compatible with Text..." RESPONSE: Yes

These are the messages displayed when closing the file:

"Do you want to save the changes you made?" RESPONSE: Yes or No - can enter either as no further changes have been made

"The file already exists. Do you want to replace the existing file?" RESPONSE: Yes or No - can enter either as no further changes have been made

View 1 Replies View Related

General :: Lock Down Application By Saving As ACCDE File

Sep 29, 2012

Trying to lock down an application by saving as ACCDE file. Saves OK but when you load application none of the controls work. I.e. button clicks do not launch "Open Form" or " Print Report" commands.But in ACCDB format application works flawlessly.

When I tried on a different machine I get an error message that says too many Table IDs. Odd since I only have 3 forms, 3 tables and 3 reports. Lots of DoCmd's and switching between the 3 forms but not sure why this would create "too many Table IDs"?

View 2 Replies View Related

Modules & VBA :: Send Pdf With Outlook Without Saving Actual File

Oct 13, 2014

I want to send an e-mail with a report as attachment.On the internet i have found two options, and both are not the best solutions.

1. option

Code:
DoCmd.SendObject acSendReport, sReport, acFormatPDF, sMailAdres

With this construction I don't have enough control over the mail, and worse, I get an Outlook message when the mail is sending which I have to answer.

2. option

Code:
Dim oMail As MailItem
Dim oAtt As Attachment

Set oApp = CreateObject("Outlook.application")
Set oMail = oApp.CreateItem(olMailItem)
DoCmd.OpenReport ReportName:=sReport, View:=acViewPreview, WindowMode:=acHidden
Set rpt = Reports(sReport)

[code]...

with this construction I have to enter an existing report.pdf on my filesystem (bold line), but I want to pass the rpt object straight to the mail as an attachment.

View 2 Replies View Related

Modules & VBA :: Remove Special Characters From File Name (when Saving)

Feb 20, 2014

I use the below code as part of a database which creates documents and then saves them using data from the form fields.

Every now and again one of the form fields contains a "special" character such as /,@,& and this prevents the file from saving.

Is there a simple addition to the below code to remove special characters from the file name if there is one present?

It causes all sorts of issues as many people don't realise that there has been a problem until it is too late.

Code:
objWord.ActiveDocument.SaveAs2 FileName:="C:UsersPublic" & Forms![Front Page]![Site 2 Name] _
& " " & Forms![Front Page]![Combo79] & " " & "O2" & ".doc"
objWord.ActiveDocument.Close

View 9 Replies View Related

Reports :: PDF Generating And Saving But Returns Blank File

Apr 18, 2013

PDF was generating and saving to the correct location, but when I open the PDF file ... it's blank =P am using access 2003 and acrobat standard 9

Code:

Private Sub cmdPDFByAssetNo_Click()
Dim MyFilter As String
Dim MyPath As String
Dim MyFilename As String

[code]...

View 2 Replies View Related

Modules & VBA :: Exporting To Excel Template And Saving As New File

Jun 25, 2014

Any definitive way of exporting a query to an Excel file and then saving it as a new file without saving over the original.

I've tried to remove any confidential info from the code below so it's not exactly the same.

Code:
Dim XLApp As Excel.Application
Dim XLSheet As Excel.Worksheet
Dim tmpRS As DAO.Recordset
Dim strFolder as String
strFolder = ("C:Profiles"& [Name] & "")

[Code] ....

The error seems to be with the SQL statement although that may just be the first error that it got to. I read that you can't refer to a Query if it has a criteria and that you have to write the SQL directly into the code.

View 13 Replies View Related

Forms :: Open A Form For Saving Results Of Query To A Text File On Desktop

May 6, 2015

I have a BE database, that when opened, opens a form for saving the results of a query to a text file on the desktop. It works fine, if the full path is entered.

The problem is, I want this saved on any users' desktop. I did some digging and found the %userprofile% variable, which when used, gives me the error.

I understand this should work in both Windows XP and Windows 7, which are the environments the full DB will operate in. So far the "EXPORT" button on the form has the following for the code:

Code:
Private Sub BTN_Export_Click()
DoCmd.TransferText acExportDelim, , "QRY_ExportPublicComment", "C:UsersMark N. McAllisterDesktopPubComExp.txt"
End Sub

When I tried this:

Code:
Private Sub BTN_Export_Click()
Dim strPath As String
strPath ="%userprofile%desktopPubComExp.txt"
DoCmd.TransferText acExportDelim, , "QRY_ExportPublicComment", strPath
End Sub

the error occurs.

View 10 Replies View Related

Unbound Or Named Combo Boxes

Mar 19, 2006

Ive got a combo box linked to fields in a form so when I value (tenantID) i selected in the combo box the record appears in the form.

The problem is, I have changed the form name Unbound (it was blank) to TenantID as I want it to appear when the form is opened, however now I cannot select other items from the combo box.

Help !! xx

View 1 Replies View Related

Modules & VBA :: Run Queries That Are Named In Table

Feb 13, 2015

Basically I want to execute every query within my database that exists in one of my tables. It should fill a recordset with the query names and loop through the database and execute each one.

When I try and run access keeps saying run-time error 3061 too few parameters (yellow line). I know the issues is with the sql, but not sure how to get around it or if this type of query is do-able.My code below:

Public Sub C38()
Dim rst As DAO.Recordset
Dim DB As Database
Set DB = CurrentDb()
Set rst = DB.OpenRecordset("mTable")

[code]....

View 6 Replies View Related

General :: Import Csv Files With Same Named Structure?

Apr 9, 2014

I need to daily import files that start with same name, but the remaining part will be Bill of lading ID (e.g. TEST_BOL 1234.csv). The next day will be TEST_BOL 1235.csv) and so on. I need for Access to import the file based on the "TEST_BOL" into my database and then delete the file from the folder. I don't know how to initialize Access to look for the prefix and import in.

View 9 Replies View Related

Queries :: Yes / No Field Named Cleared For Checks In Table

Jun 6, 2014

I have a table with yes / no field named cleared for checks.

I want to make a search form with combo box to query for cleared (yes) and not cleared (no) checks.

I tried combo box with values set in it, yes and no.

But it didn't work.

View 7 Replies View Related

Modules & VBA :: How To Copy A Query Into Named Range On Workbook

Dec 20, 2013

I have a excel object I have opened, and want to copy a query into a named range on the workbook.

heres the start have made

Sub openExcel()
'WillR - opens the specified Spreadsheet
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Set xlApp = New Excel.Application
With xlApp

[Code]...

View 2 Replies View Related

Queriong A Table With A Column Named "Date"

Nov 27, 2007

Hello,

I'm trying to query excel file which contains a column named "Date",
so when I'm trying to do a query like "select * from Table_Name" it's working fine, and I'm getting all the data including the column named Date, but when I'm doing any query which is referencing "Date" I'm getting an error "Syntax error in date in query expression"
This is due-I think- to the fact that Date is a reserved word...but when I'm trying to change the column name Date to anything else say "Date_Debut"
the problem is still there, so is there any special thing to do when querying Date column type?
Please help!
Thanks,
welid

View 9 Replies View Related

Forms :: (Upload File) Button Stopped Showing All File Types

Oct 7, 2013

I recently upgraded a DB from 2003 to 2013 and ran into the following problem.

I have a button that opens a file dialog box and allows the user to upload a file to a predetermined location (and store the address as a hyperlink). I borrowed this code from someone else on here and modified it slightly.

In any case, the button still works, but now when it opens it doesn't have an option for "All files" under file types. So I can upload MS Office files, text files, etc., but not PDF files which are by far the most common types my users upload.

Private Sub Command35_Click()
Dim dd As Integer
Dim fileDump As FileDialog
Set fileDump = Application.FileDialog(msoFileDialogOpen)
dd = fileDump.Show
Dim Yourroute As String
Dim yourrouteName
Yourroute = fileDump.SelectedItems(1)
yourrouteName = StrReverse(Yourroute)
yourrouteName = StrReverse(Mid(yourrouteName, 1, InStr(yourrouteName, "") - 1))
FileCopy Yourroute, "us170fp00dataWBO_Tool_RoomDrawings" & yourrouteName
Me.Drawing_Link = yourrouteName & " # us170fp00dataWBO_Tool_RoomDrawings" & yourrouteName
End Sub

View 1 Replies View Related

General :: Mail Merge Word File (using Data From Access File)

Mar 11, 2014

I often create contract using mail merge. I have an access file that I want to use as data source for word file. But it does not automatically.

Please download the attached file !

If there are 1 customer and 1 property, I do not need to do anything. Conversely, if there are many customers and many properties, I take time to manipulate.

Firstly, I open the word file. I have to copy and paste paragraphs that I want. Highlight of the original paragraphs is blue.

Secondly, I click 'Insert Word Field' -> select 'Next Record'.

In short, I wish to use VBA in access file to automatically perform the steps that I have outlined.

View 3 Replies View Related

General :: Forms And Queries In One ACCDB File - Path Setting To Linked Table File

Oct 5, 2014

I've got the forms and queries in one .accdb file and my tables in a separate .accdb file. The forms file links to the tables in the tables file. The tables file resides in a folder called simply enough C:acc_tables and thats where i browsed to (obviously) when i set up the linkage.

One of the users does not wish (for whatever goddamn reason) to create a C:acc_tables file to stick the tables file in , and wants the tables file in some other folder.. Unfortunately this user does not have the skills to delete the existing links and re-link to the tables file after putting it in the folder he wants.

Where in the file that holds the forms and and queries do i find the path setting to the tables linked file? Can it be changed without deleting links and then re-linking?

View 4 Replies View Related

Text File To MS Excel Multiple File Import Application

Jul 20, 2006

hello,

I would like to automate something presently done on a one-by-one basis. Here: a number of text files(containing data) are to be exported into an MS Excel file, with each text file to occupy a different worksheet. Presently, the idea is to use the Data/import external data/import data feature of MS Excel for importing the text files one-by-one into newly created worksheets(within the same workbook).

I would appreciate some advice on how to go about creating a useful MS Access application to achieve the above. I have checked the available Macros in MS Access, but I could not find one to suit my purpose. can anyone pls assist, on how I can get started?

Tokunbo

View 3 Replies View Related

Modules & VBA :: Determine Excel File Type Without Opening The File?

Aug 14, 2015

Question: Is it possible, using VBA, to determine the actual Excel file type without opening the file?

I receive data files from other departments. Seems like every time someone changes their download structure, I end up with file types that do not match the download extension (example: xlm file with a xls extension). The files can't even be opened because of this. I think I can fix it if I could figure out how to determine what the file type really is.

I'm using Office 2010.

View 3 Replies View Related

Forms :: Storing File Location And Opening File From A Form

Dec 5, 2014

i had a database that allowed me from a form to store a file location for a record on a form, so i any time i could access the record, and then open the file, usually a pdf, it wasnt stored as a hyperlink, but as long text

i made the mistake of not copying the files for safe keeping when i got a permanent position..i am now back self employed, i need to recreate the database.

View 4 Replies View Related

Modules & VBA :: File Open Dialog Does Not Allow Selection Of All File Types

Oct 4, 2013

I recently upgraded a DB from 2003 to 2013 and ran into the following problem.

I have a button that opens a file dialog box and allows the user to upload a file to a predetermined location (and store the address as a hyperlink). I borrowed this code from someone else on here and modified it slightly.

In any case, the button still works, but now when it opens it doesn't have an option for "All files" under file types. So I can upload MS Office files, text files, etc., but not PDF files which are by far the most common types my users upload.

Here's my code and a screenshot is attached.

Private Sub Command35_Click()
Dim dd As Integer
Dim fileDump As FileDialog
Set fileDump = Application.FileDialog(msoFileDialogOpen)
dd = fileDump.Show

[Code] ....

View 3 Replies View Related

Modules & VBA :: Filesystemobject File Picker Does Not Highlight Initial File

Jun 20, 2014

I am using the following code to select files using Microsoft Office's file dialog:

Public Function fTestFilePicker() As String
Dim fdFileSelection As Office.FileDialog, lstrFileName As String
Const kInitialFile = "F:TestbedTest.txt"
Set fdFileSelection = Application.FileDialog(msoFileDialogFilePicker)
With fdFileSelection
.AllowMultiSelect = False

[Code] .....

When I execute it, the file picker goes to the right folder but does not highlight the file test.txt even though that file name shows in the File name text box. Is there any way to correct this?

View 7 Replies View Related

Import A Text File Weekly Within A Batch File

Jan 30, 2006

hello everyone, i really need some detailed help as the deadline is approaching and I need to find a solution for this. Any help would be greatly appreciated

I currently have a batch file that ftps a text file from a Red Hat Linux Server to my W2k C:. I would like to make another command in the batch file that imports this text file into an existing access table. I would like the text file to repopulate the table everytime it is imported. I do not want the data added on to the existing data in the table.

Thank you for your time and insight.!!!:)

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved