Hi
At the moment I am trying to send data ( a query) to a CURRENT Excel file, I do not want it to replace the current file but instead just update the cells of that file to the new values calculated in Access.
Is it possible to do this?
Cheers all
Bikeboardsurf
:confused: :eek: :( :mad: :confused:
I am having a problem getting Access to output to an excel file.
I want to take a form that I have that has 20 or so records with 6 or 7 fields for each and put it into an excel file that is formated the way I need everythign to look.
I also need it to make the file name such as CCCAAAMMDDYYYY (3 letter company abbreviation,3 letter initials and then todays date) I am thinking that the company abbreviation will be pulled from a query, then initials will be a form that opens, and the date can be pulled from access' date function.
I tried using vb code and doing an output to comand but that did not work. I am confused someone please help if possible.
I haven't worked with access in about 2 years, so I'm a bit rusty. I was wondering, what is the easiest way, if any, to output an image stored in an OLE object field to a file, like a bmp to be edited say in paint or something via VB code?
Hi all! I'm not sure if this is the correct area to post this in, but hopefully it is!
I have a Microsoft Access database, and I need to output the content of one of the tables in a specific format-the table contains a Name field, a Description field, a URL field and an Alt Text field, and I need it to end up in a text file in this format:
NAME|DESCRIPTION|URL|ALT|
Where each line of the text field is a different product, and the content of each field is separated by the | symbol (whose name escapes me right now).
I am using a where condition on printing records from a form to restrict output to the current record. I would also like to write the current record only to a file (rtf). Have set up an output to file button which works but writes all records and there is no code option for a where condition.
I can live with this as it is only for backup but a report per record would be a neater solution.
ResultID SampleName Date SampleDate a few others not necessary in this
and tblXRFResultsConcentration
ResultID (many records linked to 1 record in tblXRFResults) Concentration CompoundName
What I need to set up is a query that will allow me to generate a report that will give an excel like format, with the column headings being the SampleName, followed by the CompoundName(s) from the other table and the "rows" will be corresponding sample name and concentrations. I am sure this is pretty easy, but I am stumped!
I have an Access db that schedules the sending of emails with attachments. I run a query on the table that returns all active users I then need to create a separate file for each active user - in the format as shown below. Each file is called "ddmmXX.epe" - where dd=day,mm=month,XX=sequential number starting 01. The file needs to be formatted ascii text file. The file extension must be .epe
I would like to print a report file from a database into PDF format.Currently I am using a macro with a "where condition" to select the particular file which currently outputs to the default printer. Converting the macro to VBA reads as follows:
DoCmd.OpenReport "Receipt - full pay new", acViewNormal, "", "[ConsultID]=[Forms]![Payment Record Type]![ConsultID]"
However, if I do an output to PDF file as below, I can't insert a "where condition" to pick the specific file. Instead, it outputs the whole unfiltered report which is 12,000 pages and 29 MB!
DoCmd.OutputTo acOutputReport,"Receipt - full pay new",acFormatPDF,"C:AccessReceiptPDF.pdf"
How to combine the 2, i.e. have the "where condition" to select the particular report page, but output to a PDF file in a selected directory.
I currently have an invoice report that runs through my database which is e-mailed to clients (automatically through vba), and then saved to a specific file path.
I'm currently having an issue with the saving part of the process with certain clients who have illegal characters in their names - for example, "Client / Other Information" where the '/' is causing the save to fail.
I'm trying to find a way to change the file name of the save file for clients with these illegal characters in their names. I would prefer not to take only part of the name (as some clients are listed as "Town/Village of...") but if there is no other way then there is no other way.
I have a button in the form of the current access file. What I want to do is when the user click on the button, triggered the vba to backup current access file. But since the file is currently open, is this possible? If yes, may I know how to do it with vba?
I have tried two methods but failed: 1) Use copytofile method, but I get permission denied due to file open; 2) Use dbengine.compactdatabase method, but it also has problem if the file is open.
:confused: I've created a form within our company database which will track hardware/software requests. I'd like to create a macro, or add code to output the data entered into a notepad file. Nothing extraordinary. I'd like for it to be like this:
Ticket: XXXXX Employee: xxxxx Reason for Request: xxxxx Quantity:xxxxx Part Number:xxxxx Price:xxxxx Shipping:xxxxx Total:xxxxx
Those are the headings of the fields and x's denote entered data. I'd like to keep the headers and have the entered data as well. Is it possible?
I have a query that runs based on a parameter a user selects on a form.
I want to dynamically create the sendobject file name based on the parameter the user selects.
Example:
My form has a parameter named medicine. When the user checks the checkbox next to medicine it runs a query for records labeled as medicine but sends the e-mail output as the query name. I want something like medicine.txt etcc...
the following code saves my report in a folder called test as a pdf file with the name MyReport. I have a string variable called RepName. How can I make the report get saved under that name.
I tried DoCmd.OutputTo acOutputReport, "Estimate", acFormatPDF, "c:Test&MyReport&.pdf" but it dosent work.
I have researched on here how to print the results of a query to a text file. I put the code in and I get an error on the openrecordset line. The error says "too few parameters, expected 4"
I tried the query in another report I export to excel and the query works.
I tried printing the whole table using "Select * from tbl_Customers" and it works????
Here is the code:
Dim rst As DAO.Recordset Set rst = CurrentDb.OpenRecordset("qryBell1", dbOpenSnapshot) Dim fs, TextFile Set fs = CreateObject("Scripting.FileSystemObject") Set TextFile = fs.CreateTextFile(pathname, True)
[Code] ....
the query returns 6 fields for printing and can filter based on whether 3 fields are filled or not on the form - Date, Campaign, Status
I'm working with Access 2010 and am trying to use the transferspreadsheet command to output data in a query to an Excel 2010 format file. Here is the line of code:
It works fine and produces the output file but when I try and open it with Excel I get an error saying the format is incorrect. If I change the extension to .xls it opens with no problem but I need it to be an Excel 2010 format with correct extension.
I have a table of addresses (of both kinds, of course), a table of invoices, and a linking table for the many-to-many, because each invoice has a delivery address, but may have a separate billing address.
in my linking table i have PKs from each table, but i also need to categorize each relationship as either a billing or a delivery address, so i added another number (1 = delivery, 2 = billing).
i've got a main query that populates general invoice Detail from just the main table (data source for main form)
the main form has two subforms, each one being populated by its own query with AddressType set to either 1 or 2, and form/subform relationships on the main table's PK.
i can't get my forms to update the linking table directly.
is this possible?
am i doing something wrong?
am i missing something obvious?
it would be nice to be able to search for the word "many".......
The work hours for a person is entered once a week, at the end of the week. The person's SkillID can change but not in the same week. For ex a person scheduled as a Welder has to work as Welder for that week.
So, I need to find now all the PersonIDs with more than one SkillID in a week and flag them as errors.
Pls check the attached image. The first entry with EntryDate as "06-May-05" and Person_Code as "MK0259" repeating with 3 different Skill Codes. Then this is a problem which I want to hight light. Hope I explained clearly.
Could someone please tell me if this is an appropriate way to ensure that all of my users open the most current version of my database each time?
I am not using workgroup security(not needed), and have the be and fe on the network drive. Right now everyone has their own copy of the fe so everytime I make a change they get a new copy emailed to them. I would like to use a batch file instead. This works but want to make sure that I am doing it correctly if I just send everyone this batch file to put on their desktop (CostSavings.bat)
@echo off
if not exist "C:Program FilesMicrosoft OfficeOFFICEMSACCESS.EXE" goto Access11
"C:Program FilesMicrosoft OfficeOFFICEMSACCESS.EXE" "V:ProjectMaterialsPurchSQECost SavingsCostSavings2005.mdb" goto end
:Access11 "C:Program FilesMicrosoft OfficeOFFICE11MSACCESS.EXE" "V:ProjectMaterialsPurchSQECost SavingsCostSavings2005.mdb" goto end
Hi, I think there is a very simple answer to this but it is giving me brain ache!!
I have a form which displays or edits 'projects', this form is bound to the projects table
each project record is assigned a location, that location is selected from a combo box.
When the Location is selected in the combo box it stores the 'Numerical' value to the [location] field in the projects table.
my question is this: how do i create a query as a base for a report that will list projects by location but give the location name (as it appears in the combo) rather than its numerical value as stored in the table?
ok guys- I am struggling here. I've been trying to figure this out, got a small portion of it completed- run the query and I run out of Temp disk space- so it never gives results.
Basically- I have all the property data in one table. The goal is to find the how a property listed for sale compares to all those properties similar to it have sold for in the past x amount of months. I want to compare it to all the other houses in the same area (these are Sold status). The Sold houses have to have the same number of levels (stories), be in the same area (Area) of town, have sold in the last x amount of months (eventually I will compare the houses that have sold int eh past 3, 6, 9, and 12 month time frames), and have a square footage range of +/- 15%.
For example- There's a house for sale (Active status) for $200,000. It is 2,000 square feet, built in 1995, has 1 level, and is in Area 510. I want to compare it to all the other houses in the same area, similar to it- which means, +/- 15% of the Square Footage (1700-2300), in Areas 510, has only 1 level, and was built in +/- 10 years (1985-2005). I then need to take the average $/sqft of THOSE houses, and compare it to my one active house. Let's say there's 10 houses matching that description, and the Avg $/sf comes out to $240,000 on average for those 10 houses.
So- the final result will be: 123 Main St Active 2,000sf 1995 1 (level) 510 (Area) $200,000 $240,000 And then a calculation of Asking Price divided by the Avg Sold Price of Similar houses which, = 83.3%
All the data/fields are in one table. I have been trying to work nested queries- but, I've only got 2 or 3 specs in, and it runs out of space on my temp disc. So, I believe I'm building it wrong. Can someone please help me out to figure out how to accomplish this? I've got more to add onto it- but- I think if I can get this part figured out, I can do the rest on my own... Thanks a ton guys!
Hi all, i am new to the forum and i hope somebody can help me..
Apologises in advance if this post is out of place..but i really do need help!
I have created a database in work that will be used to track training history for employees. It consists of two main tables:
Employees: Name, Start date, Department, Manager Class: Class name, Class Date, Duration, Attendee1, Attendee2, Attendee3 upto Attendee 24 (Max amount of trainees in a class)
All is working ok, and i can populate the tables fine using forms. I can now view class information, and see who attended what class.
However i need to be able to view an individual employees training history. ie
Joe bloggs has attended the following classes:
Class 1, 12/01/06, 8 hours Class 2, 14/01/06 8 hours
I think i need to create a form which will allow me to enter an employee name. This name will then be checked against attendee1, attendee2 etc in the class table and it will then flag back any classes that the employee has attended
I hope i have explained this ok, but i really do need some advice on how i can go about doing this..:confused:
I have very quickly realised that there is a wealth of knowledge on this site, so i am hoping that you guys may be able to help..
I have been working on this for a few weeks now, and books dont seem to have the answers!!!
First of all i apologise for posting double, but i m compelled. I badly need help. i m not an expert like you guys. I hope someone will surely come to my rescue.
I have a problem with summing values in a query that is based on 5 tables.
In my form i have a text box which shows the total quantity on hand. The formula comes from all 5 table fields. for example:
GOODS RECEIVED GOODS SENT REPAIR RECEIVED REPAIR SENT ISSUES Trx_Qty Trx_Qty1 Recd_Qty Sent_qty Issued_Qty
The formula works this way: Expr1: [trx_qty]+[recd_qty]-[Trx_Qty1]-[Sent_qty]-[Issued_Qty]
When the records are limited to one row only then all works as desired, but as soon as i add more records in REPAIR RECEIVED Table and REPAIR SENT Table i get multiple rows in the form. Also the sum is not correct. For example:
GOODS RECEIVED GOODS SENT REPAIR RECEIVED REPAIR SENT ISSUES Trx_Qty Trx_Qty1 Recd_Qty Sent_qty Issued_Qty 40 10 5 10 20
In the above example the formula gives following result
Expr1: 40 + 5 – 10 – 10 – 20 = 5 Expr1 = 5 (This is quantity on hand)
Bu now when I add more rows to other tables I get multiple rows and incorrect sum. Example
GOODS RECEIVED GOODS SENT REPAIR RECEIVED REPAIR SENT ISSUES Trx_Qty Trx_Qty1 Recd_Qty Sent_qty Issued_Qty 40 10 5 10 20 5
I m attaching the database for you to have a look at it and come up with the solution.
Please help me I m badly stuck
I tried using group by and sum functions but no use
I have a listbox and all is well - the only problem is that the column heads are a little 'ugly' - my column names are usually something like 'catagoryName', 'productType' and 'price' instead of looking pretty, like 'Catagory Name' and 'Product Type' and 'Price' respectively.
Is there any way to edit/format the title/column heads without having to change all the tables and queries etc, so they look a littler prettier?
What I'd like to do is have an "export button", where the OnClick event, exports a single table into a new accde file. This would allow the end users to zip this file up and send it to me.
Because of all sorts of stupidity, I have no network capability and must send data back and forth via email.
I have digressed to a replication table that needs to be uploaded, once data is entered by the users...
Because the files can get relatively large (for emailing purposes), I am trying to figure out how I can get just one table from them vs. sending the whole application file back to me... It's pretty vital that they not be able to edit the table because that could really mess up the process.
So any way to create a new lock file from within the current Db?
Whenever I export reports to PDF, the output appears zoomed and clipped. No extra pages are generated as they would be if I'm going over margins, it's just the report is clipped.
The report looks perfect in preview mode, and it looks perfect when going to an actual printer. However, when using OutputTo to save it as a PDF, this is when the report content is clipped.
I open the report in preview mode first so events are fired that show/hide various objects based on fields in the recordset.
I've tried reinstalling, and I've tried this on two different machines, one running Windows 7 and one running Windows Server 2008...both with the same results.
I have a vba code export a error message if the current date of a file is not correct.. I have tested the code it worked to send a error message to a error.txt file but he it doesn't look to the modified date
So instead of:
file1.txt (13-02-14) Then Send error message ("file not updated") to: Error.txt
IF NOT no action requeried
This code does the following :
file1.txt (Modified date: 13-02-14) Then Send error message ("file not updated") to: Error.txt
file2.txt (Modified date: 14-02-14) Then Send error message ("file not updated") to: Error.txt
Code: Sub CheckD() Dim FSO As Object: Set FSO = CreateObject("Scripting.FileSystemObject") Dim objFile As Object: Set objFile = FSO.GetFile("C:Users ameDocumentsShow5621.txt") If objFile.DateLastModified <> Date - 1 Then
[Code] .....
So also if it is the current date he send the error message to the error.txt file, it could be possible that i did something wrong.