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 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 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...
I have a piece of code that I'm using to display an image on a report based on a path saved to each record. the code is:
Code: Option Compare Database Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If IsNull(Me.ImagePath) Then Me.ImgPic.Picture = "O:BellinghamIntranetProductionLabelsNo Label.bmp" Else Me.ImgPic.Picture = Me.ImagePath End If End Sub
It seems like every few months the code crashes access and then never works again. When I debug, the part that is highlighted is:
Code: Me.ImgPic.Picture = Me.ImagePath
The only way i've found to correct it is to delete the report and the module and copy them back in from a backup database. What could be causing this code to crash or how to stabalize my database to prevent this from happening again.
Been hunting a round looking for some code that will output my access report to excel but more inportantly add a unique field from the report to the name of the file. example would be [FileName] & [ReferenceNo].xls.
How do i make my subfrm record source switch to another saved query (qryPendingStatus) when it's opened from the form.
Heres what i am trying to accomplish: I have a subfrm that i'd like to use to display info in 2 different forms.
There's a form currently for All statuses. Then another new one for Pending status. I'd like to use the same subform for this pending status form also, and in doing that my qryAllStatuses, but change to qryPendingStatus on the subfrm when i open the mainfrom.
This is on the open even ofthe mainform, but does not work (says method not founds...so obviouly i can't use ".Recordsource" here: Private Sub Form_Open(Cancel As Integer) Me.subfrmJobInfo.RecordSource = "qryPendingStatus" End Sub
I'm currently looking to change the ending of all filepaths of imported files whenever I run the import. I want to change the path ending from .txt to .doc. So basically, the link/path to the file should be got, the ending changed from .txt to .doc and then the path (with the .doc ending) put into the table.
Code: Private Sub bimportinternal_Click() On Error Resume Next strFolderPath = "S:Foo reportsSearchable" strFolderPathSave = "S:Foo reportsSearchableArchiveword" & objF1.Name Set objFS = CreateObject("Scripting.FileSystemObject") Set objFolder = objFS.GetFolder(strFolderPath) Set objFiles = objFolder.files
The code below successfully saves a .pdf file to my c: drive. However, on occasion i want to overwrite a previously saved invoice e.g. 3815-140515-Bristol with an amended invoice but retain the same Invoice Number e.g. 3815-150515-Bristol.
Currently, if i save the invoice with the same invoice number but a different date it just saves down without overwriting the original invoice. Leaving 2 invoices with the same invoice numbers but with 2 different dates.
What I want to achieve is: Once I hit the SaveInvoice button the code will check that invoice Nr 3815 does not exist in c: drive and save normally. However, if it does exist a msgbox will then prompt me to overwrite.
Current code:
Private Sub SaveInvoice_Click() 'Save Invoice as PDF and annotate invoice number, site name, and date Dim slFileName As String ' create the invoice as a pdf slFileName = Me.txtInvoiceNr.Value & "-" & Format(Date, "ddmmyy") & "-" & Me.SiteName.Value & ".pdf"
Do you have a code that would open a saved file based on the contents of 2 textboxes on my form.
The saved files would be in: C:Documents and Settings100310257Desktop
I have a button on the form, but need a code that would pull up the savedfile using the name in textbox1 and the name in textbox2, like this: textbox1-textbox2. e.g. textbox1 = Novo Group. textbox2 = AA There is a saved file in the path above, Novo Group-AA
how to change background color of MSAccess Reports using VBA? How can I do border coloring. What are the vba codes for all color options like light green, light blue etc. How to change the font type to bold etc using vbaI did some changes to text box coloring in Detail Section on format click event.
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'm trying to put together a few lines of VBA code to export a report called "Rework Label Report" to a specific network location in PDF Format, I have already achieved this level of code and it works fine (code below); however each report has a unique number in the database [ID] which I would like included in the title of the PDF when exported and saved?
Code so far:-
Private Sub Command20_Click() Dim stReport As String Dim stSubject As String
[Code]....
Me!Combo3 is a combobox on form which selects the number of the report to be viewed ,the user then sees a preview of their chosen report and then clicks Cmd20 to export to PDF, currently the file is named Rework Label Report when saved.
I have one more problem about the version 2000 since it was not happen in version 97. I have changed several report formats margin lots of times (for example .25" for left and right margin to fit on one page) and when I open the reports next time or other users access them from the server (since the application residing on the Novel server) the format keep changing back to the default (1" for all margins: top, bottom, left, right)!!
Please let me know if it is a "bug" in Access 2000 and HOW to fix it!!
I am having problem to keep the desired format for reports' margin (left, right, top, bottom) and paper size (letter, legal), and orientation (portrait, landscape) stay!!
Currently, I have one MS Access 2000 database application resides on Novel Netware server version 6.0, [B]although I open the Access database exclusively to change all my reports design to the way I like, and SAVED them properly; however, later when I and other users view those reports, the formats change back to default view, which are "letter size, portrait and all margin set to 1")??
It is very STRANGE and FRUSTRATING and incovenient since all users have to manually go to "Page Setup" of the report's design everytime to change margins to make the data display nicely on one page!! It has never happened like this in version '97!
Plllease let me know if ANYBODY has any SOLUTIONS to this bug of version 2000 of Access?? Or any UPDATE file released to help get rid of it??
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:
: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?