General :: Saving PDF - Testing To See If Directory Exists
May 31, 2013
I'm starting to automatically save PDF copies of certain reports in predetermined locations. I need to copy a file to a particular directory (based upon various criteria), but if the directory does not exist, I want to create the directory on the fly first. Otherwise I will just proceed with the copy.
I'm sure there is a DOS command to do this, but I can't find it.
View Replies
ADVERTISEMENT
Nov 5, 2014
come up with the below code to create PDF documents based on a query. It has been working great but I have a change that I need to make and can't figure it out. The code below creates all the documents in one folder "serverD$DocumentsInvoices" but I need it to create a separate folder for each PDF so that the file (Invoice1234.pdf) will be in the folder (serverD$DocumentsInvoicesInvoice1234Invoic e1234.pdf). That folder does not exist, so I need to create it and then save the PDF into it.
Code:
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim qdf As QueryDef
Set db = CurrentDb
Set qdf = db.QueryDefs("Invoice_Report")
Set rst = qdf.OpenRecordset
[code]...
View 3 Replies
View Related
Aug 28, 2013
I have some code that resides in a button on a report that allows me to save a PDF version of this report. My problem is that if i have the destination directory open on windows explorer, i get a runtime 2501 "The output To action was cancelled" error.Is there any way to check if the directory is already open, and cancel the output to, or close the window to avoid this error?
Here is my code:
Code:
Private Sub CmdSavePDF_Click()
Dim MyFileName As String
Dim MyPath As String
'Dim CompanyName As String
[code]...
View 1 Replies
View Related
May 4, 2014
I am using Access to save an Excel file in a particular directory. The code was created about 10 years ago and hence saves the file with .xls extension and I would like to save with a .xlsm extension. If I just change the .xls to .xlsm, in the code below, the file is saved but the Compatibility Checker comes up (I would like to stop this) and when the file is reopened I get an error message stating there is a file extension problem and the file won't open.
Code:
strExt = ".xls"
'If .txtFriendlyName <> "" Then
' strDestFileName = .txtFriendlyName
'Else
' strDestFileName = Left(objFile.Name, Len(objFile.Name) - 4) & MakeFilePosfix(Now())
[Code] ....
View 7 Replies
View Related
Aug 1, 2013
This code below works, but alot of what it does is unnecessary. I have a directory structure named 1000-2000, 2001-3000, 3001 - 4000 etc and within that is the individual folders 1000, 1001, 1002 etc
How do I test to search top level folder thats no larger than correctNum to then test the subfolder for correctNum? I've looked at instr and a few other funtions, but can't find a solution. Below is what I have now, it works but I know it searches everything and that's not correct
Dim filesys
Dim Subdir
Dim folder
Set filesys = CreateObject("Scripting.FileSystemObject")
Dim oDir
Dim bDir
CorrectNum = Serial.Value
[Code] ....
View 3 Replies
View Related
Apr 6, 2014
I actually have about 13 separate fields in a table I'm trying to summarize in a single report field. Each field corresponds to a particular action taken. If the action was taken the field value is 1, if the action was NOT taken the field value is 0. The report needs to contain a single field that lists all actions taken. I tried doing this with an If statement formula on the report, but it does not work.
=(IIf([ACTION_VQ_SCAN]=1,"VQ Scan")) And (IIf([ACTION_OTHER]=1,[ACTION_OTHER_SPEC])) And (IIf([ACTION_CULTURE]=1,"Culture(s)")) And (IIf([ACTION_DRUG_THERAPY]=1,"Drug Theraphy"))........ and so on
It looks like it expects all if statements to be true, thus the formula does not return anything. Usually only 1 or 2 actions are actually taken, but I need to account for the possibility of any and all combination of actions.
View 3 Replies
View Related
Jul 9, 2014
In Access, how to determine a directory with given path which is empty?
View 7 Replies
View Related
Aug 14, 2013
I have a table called 'maintable'. It has 5000 plus entries of employees with different fields. Every Employee has unique ID. One field is date of birth (dob). Normally more than one person can have the same date of birth. A form (maintable1) is created to enter data into this table.
In order to avoid duplicate entry of the same employee again with all his data, I wish to know if the same date of birth (dob) which is being entered now already exists for any employee to verify if the employee being entered is the same, if not then I can enter the data of new employee with the same date of birth.
So basically when I will enter data in a form for the dob field, if the value is the same, then a message that entry already exists, then the 'maintable' may open highlighting the same date of birth entry, so it can be verified if the same person is not entered again.
View 9 Replies
View Related
Nov 27, 2013
I have a table with several thousand records. Each record as a path field that indicates a specific file that is associated with a given record (not just a directory, it identifies a specific file). I'm pretty sure that most of them are correct but I've seen and been cleaning up paths that have had typos in them or were otherwise not setup correctly. Is there a way that I can generate a report or a list of some sort that would tell me exactly which file paths exist and which ones don't? or even just the ones that don't.
View 4 Replies
View Related
Mar 18, 2014
I have one table let's call is table1. It contains about 5 columns with standard employee data with about 10,000 rows of data containing about 1,150 employees. All employees have multiple rows of data. There is one column titled JOB. I need to pull all rows of data for each employee ONLY if there is at the minimum one value for the employee in the JOB column. I do not want to pull employees that have no values in the JOB column. They can be excluded from the query.
Example of all record for one employee. I need to pull all rows of data ONLY if the employee has a value in the JOB column.
Name EE_ID JOB CAT EFF_DATE
John Doe 1006 CLERK F 01-JAN-2010
John Doe 1006 P 21-JAN-2010
John Doe 1006 CLERK P 01-FEB-2011
John Doe 1006 F 01-MAR-2011
John Doe 1006 P 01-APR-2011
John Doe 1006 CLERK F 01-JUL-2012
View 3 Replies
View Related
Oct 7, 2012
By the way, my FO line manager wants an IT report, i am wandering if there is any possibility to search and export users. The report should show in the status column who are disabled, who are enabled, date created and date expired in date column in active directory windows server 2003 environment?
View 1 Replies
View Related
Aug 22, 2014
I'm trying to use DCOUNT to check to see if a date exists and if it does then i can cancel the input. The code im using is as follows however its returning datatype mismatch.
Code:
If DCount("[pick_date]", "tblPicker_Stats", "[pick_date] = '" & txtPickDate & "'") > 0 Then
MsgBox "Statistics for this date already exist", vbOKOnly, "Error"
End
End If
View 7 Replies
View Related
Jul 10, 2014
I have created 10 User Group Accounts, and have set Permissions for the first 7 successfully. However, no Permission settings are being saved for any subsequent Groups. (Access 2010 managing a 2003 mdb file, Front and Back client)
After having experimented a little, I found that while Access allows you to create a Group name with 20 characters, any Group with 20 characters in the name does not save Permissions.19 Characters seems to be the maximum characters a Group can actually be named with.
View 1 Replies
View Related
Oct 20, 2013
I am writing a program in Access 2010. My check boxes are not saving to the table. I have stepped through the code with no errors and it only saves the last check box to the table. Here is my code:
Private Sub cmdSave_Click()
On Error GoTo cmdSave_Click_Error
Dim rs As Object
Dim db As Object
Set db = CurrentDb
Set rs = db.OpenRecordset("tblUserPermissions")
[Code] .....
I attached the full code.
View 14 Replies
View Related
Jul 6, 2012
I have a stock db with records that go back to 2006. I want to clear some of the old records but save them incase required. I still need to leave from 2010 until present on the db. I have a front and back end on the db.
View 1 Replies
View Related
Nov 26, 2012
I have created a form and a subform within it, I have managed to populate all the dropdown boxes from the tables I need. but I need to save all the information in putted to a table called bookingstbl and I do not know where to begin?
View 6 Replies
View Related
Dec 4, 2013
I'm working on a database that will be used by two different groups. Group A provides a list of items to be investigated by Group B.
I'm wondering if it is possible to:
i) have Group A create an excel file of items to be investigated (let's call the file tblNEW)
ii) open a record in the file through a form (let's call the form frmINPUT) to allow Group B to input investigation findings
iii) save the modified record into a separate table of all the work that has been done (let's call this table tblWORK)
iv) delete the investigated record in tblNEW once it gets saved into tblWORK
View 1 Replies
View Related
Sep 16, 2014
I have a database that I've created for a number of clerks under me to use to track their daily tasks.
When clerks are entering their tasks, they do so through a number of combo boxes on a form (Assigned by:, Division of Law:, Subcategory:, Casename etc). When all of the combo boxes have been filled, the employee can click a button in order to save the record to the back end of the database and open a new blank record.
Currently, if an employee tries to enter the wrong data in a combo box and save the record, they will be prompted to enter data and not allowed to save the record; the problem is that if they leave all fields blank they can still save the record - thus creating useless data for reporting purposes. For example, an employee could enter their name and the date of record but leave every other combo box blank and still save the record. I want to lock the form such that they cannot save the record unless all of the combo boxes on the form are populated to reduce user error.
How can I do this simply?
View 13 Replies
View Related
Sep 16, 2012
I have a database that creates many forms based on queries which are based on user-defined variables. These are permanent variables added directly in the query, such as "if an employee is late 4 times in a month, we yell at them." I would like to be able to change this to "5 times in a month" if the users want to.
Rather than waiting for that to happen and having to change all my queries, i want to set up a form for them to access and edit the variable, save it, and then my queries to reference that variable.
My question is what is the best way to store and reference them? I could create a table, but i am not too sure how easy it would be to make my queries work with that.
I could also add them onto my main form which is always open, but I'm not sure how to make them save when access is closed. (a quick trial from my variable form won't let me update either a text box or label value on the main form).
View 5 Replies
View Related
May 6, 2014
I have some field in my details section,It works like a grid view,if I search data by query then It shows all of the related data from database,then I edit or save data one by one,but the problem is I want to disable text box after edit/save data.But if I write code like--
If Me.Text103 > "" Then
Me.Text103.Enabled= False
Else
Me.Text103.Enabled= True
End If
It disable the all of the rows,but I want to disable only the specific field where I enter the data.
View 4 Replies
View Related
Jul 17, 2013
find the attached MS access DB for INVOICE printing . I am facing two issues there .
1. {form INVOICE } sub-total must be Calculated from line total on {INVOICE DATA Subform} , I know this can be accomplished by adding a new field at sub-form and calling that value to main form's sub-total field .
2. And the real issue is i want to save this value from subtotal on form INVOICE to table field name subtotal .
3.I wish to make a reporting format for each INVOICE NUMBER , whenever report is being generated , the report shows more than 1 invoice details .
View 2 Replies
View Related
Oct 16, 2013
I created a Microsoft Access database and access to the system must be controlled by User Access Level Control. The level of the user determines whether the user can add, edit, delete or view a certain form.
I created three tables which are linked via foreign keys: tblUsers, tblUserRoles and tblPermissions. (See the Tables attachment)
I designed the Permissions form to be user friendly by adding checkboxes on the form so that the Administrator can select whether a new user has Add, Edit, Delete or View rights. (See the User Level attachment)
To test my code I added a user as an Administrator. The problem is that when I select the Add, Edit, Delete and View checkboxes, it only saves the last checkbox to the Permissions table. The Administrator must have Add, Edit, Delete or View privileges on the Employees form, but now he only has View privileges. My code does not generate an error. (See the Incorrect attachment)
The Permissions table is suppose to save four entries(See the Correct attachment)
Here is my code.
Private Sub cmdSave_Click()
Dim rstPermissions As Object
Dim dbFSManagement As Object
Set dbFSManagement = CurrentDb
Set rstPermissions = New ADODB.recordSet
[Code] .....
View 14 Replies
View Related
May 4, 2014
I have 4 users all with the same rights. What I want to do is lock each individual record created by each user from the other 3 users after they have been saved ( I am not referring to record locking/table locking while updating/creating ). i.e., They can all read each others created records BUT only update/modify their own created records. They all have individual passwords to log in.
View 4 Replies
View Related
Nov 7, 2012
I'd like to have a button on my dashboard that gives the user the ability to back up the database and save it with a different date. For example, existing database called "Fishing.accdb" and I'd like to have code behind a button that allows the database to be saved as "Fishing0711.accdb"
I'm trying to avoid the user having to go into the File Save as menu system....I've tried the docmd.copyObject method but can't get it to work
View 10 Replies
View Related
Dec 23, 2004
Hi guys...got a problem here....
I got a query which joins two table....
Individual
fid1
fQSname
fQSRegno
Point
fid2
fQSRegno
fQSPoint
Tables join using fQSRegno.
Scenario is
Tbl Individual contains all the members info.Tbl Point contains point given to members who attend courses. Problem is when I created a query...
Query1
fid3
fQSname
fQSRegno *from tblPoint
fQSPoint
the data shows only members who got points. Is it possible to include member who don't have point like new registred member to show in this query....
TQ
View 1 Replies
View Related
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