Modules & VBA :: Using Date Field To Create Folder Name

Feb 27, 2015

Is there a way to use a field with date in it to create a folder?

the field has a data like this 15/05/2014 in it and the / will not work in folder creation. So I was wondering how to get around it.

Code:
MkDir "c:TestAccess" & Me.Date_In & "/"

View Replies


ADVERTISEMENT

Modules & VBA :: Create A Folder For Every New Record

Jun 22, 2013

I want Access to create a folder for every new record that is added to the database, and the folder name has to be a value of that record.

To make it clear: [URL] ....

The foldername has to be "123456789" for the first record.

View 7 Replies View Related

Modules & VBA :: Create Folder And Sub Folders?

Jan 30, 2015

I have the below code to create email and folders based on data from the database. For now, I'm able to create the main folder and add a word document inside. What could be changed on the code or added to add 2 sub folder named "Documents" and "Correspondence"

Greetings.

Code:
Option Compare Database
Private Sub SendEmail_Click()
On Error GoTo Err_open_word_Click

[Code].....

View 6 Replies View Related

Modules & VBA :: Open Folder Nested Inside Main Folder?

Mar 16, 2015

I'm trying to open a folder based on a BIN nr. This folder could be in a main folder that has diferent subfolder. As there where differnt naming used to create the folderes, one of the things they have always is the BIN nr. It alwasy start with a unique number and maybe I could use it to scan the subfolders and open that one that the BIN nr is equal as in the field BIN.

Now we have serveral 1000th of folders and finding them takes time.

View 3 Replies View Related

Modules & VBA :: How To Save File From Attachment Field To External Folder

Sep 5, 2014

I have a table with an attachment field called email, where a .msg file is stored for each record. Looking for code to save this contents of this field in a folder in my drive.

View 1 Replies View Related

Create A New Folder

Oct 25, 2005

I would like to create a new folder with a specific name.

example

I have a k: drive where i want the new folder created

I want to name the new folder under the k: drive.

Im sure this is very easy to do, but i can't seem to find an example in the forum.

thanks in advance

View 1 Replies View Related

Forms :: Unable To Create Command Button To Open Folder On Desktop

Feb 19, 2015

I am simply trying to create a command button to open a folder on my desktop

Cannot seem to find this code

This is the path to the folder I want to open

C:UsersJONATHANDesktopCMS FILES

View 4 Replies View Related

Join Three Fields Together And Create A DATE Field

Feb 20, 2007

I am editing data in a table that was designed by someone else. For some reason, they divided the date into three columns (YR, MON, DAY). I would like to join these three fields together and create a legal DATE field. I have tried the following:

SELECT YR AND MON AND DAY AS TheDate
FROM MyTable;

However, it returns an odd result. I think this might be because ACCESS does not know I want a date format.

My question is: is the above QUERY correct and how do I tell ACCESS to put the concatenated data in a date format.

Thanks in advance for any help you can provide...

View 5 Replies View Related

Modules & VBA :: Date Field To AutoPopulate Other Date Fields To Future Date

Oct 24, 2013

I'm trying to get my "IncidentDate" field to autopopulate two other date fields to a few days from the "IncidentDate". The other two date fields are "ContainDueDate" and "RootDueDate". I'm trying to accomplish this on my "Test CAP Form"

I tried using the following in the BeforeUpdate of "ContainDueDate" and received a complier error: expected =

Code : DateAdd(d,2,[IncidentDate])

so I removed the parenthesis and nothing happened

Code : DateAdd d,2,[IncidentDate]

I even tried redoing it in the AfterUpdate of "IncidentDate" and nothing happened either

Code : DateAdd d,2,[ContainDueDate]

I'm not sure if I'm even using the right function to get what I want.

View 4 Replies View Related

Modules & VBA :: Create Table Yes / No Field

Aug 26, 2014

I have the following vba script and I can not get the yes/no field to work, also with adding field properties of required = yes and the text field to be 50, just examples are fine and I will update what I want.

Code:

Sub test()
Set Db = Application.CurrentDb
Set tdf = Db.TableDefs("1Testing") ' 1Testing is your table name
' First create a field with data type = Text
Set fld1 = tdf.CreateField("FieldT1", dbText) ' Field1 is your Field Name and formatted as text

[Code] ....

View 1 Replies View Related

Create Field That Auto Populates With Record Creation Date/time?

Feb 11, 2008

I think my question is fairly simple - fingers crossed.

I want to create a field that, whenever a record is added, it auto-adds the date & time the record was created. I'd call it Book_Date_Added, or something like that. I tried snooping around the Default Value options but couldn't figure it out.

The table exists and it already has some records, so I'd need to know how to add this field rather than how to create it when I create a table (although that would be helpful too, if it's somehow different).

I'd appreciate any help, thanks a bunch.

View 3 Replies View Related

Modules & VBA :: Create Multiple Records Based On Date Range - Button Click Event

Jul 31, 2014

I work for a company that manufactures home appliances & electronics. When those products fail within the warranty period, we are obligated to repair the units for the customers.

We have around 200 factory technicians who make those repairs. Each tech is able to make approximately 8 repairs each day. We have a dispatching system that assigns the repairs to the techs based on their availability each day. But the problem is that we have to manually enter and adjust the schedule for all 200 techs every single day, and this takes a lot of time. And of course technicians get sick, take vacation, etc, so we have to adjust the schedule so no techs will be assigned calls when they're off.

The problem: For example, currently when a technician takes off for 2 weeks, the user has to enter 14 individual records for the tech, which is somewhat time consuming. What I need is to program a button click event to determine the two dates (startDate & endDate) and append multiple records from one single entry in the form for each date in between and including the two date fields.

I know I'll probably need to create a loop that will loop through the two dates on the form and append a record for each day, so I can then cross reference the dates to the master schedule dates to make sure that no availability is opened for the techs taking time off.

View 3 Replies View Related

General :: Create A Field With Start And Finish Date On Certificate Formatted Correctly

Aug 22, 2013

I am creating a access db for use with a training company. All is working great.

What I want to do is create certificates within Access and then print by the Course load. Easy enough and I can do this.

The courses usually last two or three days, so i want to create a field which has the start and finish date on the certificate formatted correctly.

I currently use this

Code:
CourseDate: DatePart("d",[StartDate]) & " & " & DatePart("d",[EndDate]) & " " & Format([EndDate],"mmmm") & " " & DatePart("yyyy",[EndDate])

within a query which returns this

29 & 30 May 2013

what i want to print on the certificate is this

29th & 30th May 2013

I need to have the 'st' or 'nd' or 'rd' or 'th' in the date.

View 3 Replies View Related

Forms :: Create Button To Enter Current Date / Time In Field Where Cursor Is Presently Placed

Jan 14, 2014

Looking to create two command buttons or two keystrokes sets in an Access 2007 form that will allow me to place a current date and time in any allowable field where the Cursor is presently placed. Similar to what was in Access 2000, ctl: (for the current date) and ctl shift : (for the current time).

View 2 Replies View Related

Modules & VBA :: Create X Number Of Duplicate Records According To A Field On Subform

Jun 13, 2013

I have a code that works great from the parent form but I decided to change the format and call it from a lostfocus event in the subform instead. Now I keep getting error 3314:"You must enter a value in the tbGuests.LastName field".

The code should copy the parent form fields and create x number of duplicate records according to a field on sub-form. It then runs an append query to add the information from the subform.

Code:

Private Sub GuestsInParty_LostFocus()
Dim partymsg As Integer
Dim dbs As dao.Database, rst As dao.Recordset
Dim F As Form
Dim intHowMany As Integer
Dim intCounter As Integer

[code]....

View 1 Replies View Related

How To Open A Dialog Box To Move Files Inside A Folder That Is Setup As Current Folder

Sep 2, 2015

I'm trying to automate a process of selecting a set of file/s and move them in a folder. When I click on a button, it should open a current folder that is setup in the code.

Lets say that I have a folder C:documents est, and very time I click on the button, it should open the dialog box with that path so I can select the files from another folder, drag them there and they will be saved in that folder.

This will form part of wider automation that will send an email stating that those file/s where placed in that folder.

I have in the same form where the button is placed, 3 check boxes that needs to be passed to the email as well that one or all the files where placed in the folder.

View 10 Replies View Related

Modules & VBA :: Create Unique Reference Number Based On Field Values For Record

Jun 18, 2015

I want Access to automatically generate a reference number for a record based on the values in on two other fields for a given record using a form.

The first field is called Operation Number.

The second is Bag Number.

The reference number needs to be in this format: 19C.3.1

Where 19C is the Operation Number, 3 is the bag number, and 1 is automatically generated. Additionally I need the last number --the automatically generated one--to go back to 1 if with each new bag number.

This is kind of like library catalog numbers. Not sure how to do this.

View 2 Replies View Related

Modules & VBA :: Unable To Extract Day Number From Date Field And Write It To Day Field

Jan 10, 2014

I am trying to do some simple table operations. I have a field (Date) containing dates, and an empty field called Day.

I want to extract the day number from the Date field, and write it to the Day field.

I didn't get very far until I ran into trouble when setting my recordset. I get the error "Too few parameters, expected 1". Clicking "Debug", will highlight the code line "Set rs = db.OpenRecordset(sqlString, dbOpenDynaset)".

So far, my code looks as follows:

Code:
Private Sub Command16_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim sqlString As String
Dim dataDay As Byte
'Open connection to current Access database
Set db = CurrentDb()

[Code]...

I am not very familiar with the various types of recordset settings. I just want to be able to read data from the Date field, and write data to the Day field.

View 12 Replies View Related

Modules & VBA :: Up One Folder In FilePath

Jan 24, 2014

FilePath = CurrentProject.path

I am currently using this path, but I moved my database folder into another folder so people won't mess with it. I still need to create files to the original directory. How can I make the FilePath still relative but up one folder from CurrentProject.path?

View 5 Replies View Related

Modules & VBA :: Merging All PDF Files In Particular Folder

Oct 25, 2014

I'm trying to write a simple little database. At one point on a form, I'm trying to merge all the pdf files in a particular folder. (I'm using the pdftke.exe program and there will be multiple pdf files)

It all works perfectly if I call it as below, with the actual paths already hard coded. It combines all the pdf files and renames it to the "merged filename.pdf" correctly

Dim stAppName1 As String
stAppName1 = "C:a folder namepdftk.exe C:another folder nameprints*.pdf cat output C:folder where merged file will bemerged filename.pdf"
Call Shell(stAppName1, 1)

However, I'm trying to have it work with the middle portion (the folder where all the pdf files are) being created on the fly so to speak.

The middle portion/path I have stored from a previous form and it's stored in a table.

So I'm trying the below, but doesn't seem to work.

Dim stAppName1 As String
Dim combine_files As String
combine_files = (this pulls a path from a stored field on the open form) + "" + CStr("*.pdf")

stAppName1 = "C:a folder namepdftk.exe (combine_files) cat output C:folder where merged file will bemerged filename.pdf"
Call Shell(stAppName1, 1)

With the code above, it doesn't seem to do anything.

View 2 Replies View Related

Modules & VBA :: Loop Through All Files In Folder?

Aug 26, 2014

I believe this is most recurring scenario for all. Any simple way like:

Code:
For each file in folder.files
Msgbox File.Name
Next File

For your information the above code doesn't work

View 10 Replies View Related

Modules & VBA :: Copy File From One Folder To Another

Feb 28, 2014

I need to create a function that I can launch using a macro that will copy an excel file from one folder to another in the file system.

View 4 Replies View Related

Modules & VBA :: Move Entire Folder

Dec 12, 2014

I have a form which has a field called quote directory, this contains the path of the quote documents and sub folders, I also have a field called project directory.

When a quote is confirmed I have it all working so a new folder is created with specfic details like project number etc.What I want to do is move the folder from the quote directory and put it in the newly created folder in the project directory.

View 2 Replies View Related

Modules & VBA :: Combine PDF Files In A Folder

Oct 21, 2013

I added to my database a button to ouput the data to PDF. It works as it should. We do print out the letters in paper and put a copy in the folder from the client (connected with the ID nr). From time to time we need to attach a PDF document to the letter and combine it. My question is now if it is possible to have some code to the button that when it finish the output to PDF it will combine all the PDF files that are in the folder and put it in a second folder. After that, I need to put the combined PDF in another folder.

View 6 Replies View Related

Modules & VBA :: How To Check Empty Folder

Jun 12, 2013

I use code to check folder as below.

If the folder not exists, then create it.

If dir(myfolder) = "" then
mkdir(myfolder)
end if

How to add code to check empty folder, like below?

If dir(myfolder) = "" then
mkdir(myfolder)

else if empty(myfolder) then //there is no empty function in access
do something
end if

View 2 Replies View Related

Modules & VBA :: Hyperlink To Folder In A Form

Sep 26, 2013

I put in contracts in a form in Access.

Each contract has a Special ID. it's called mietvertragsnummerID (German Word).

Now i want by pressing a button, that for the choosen ID, a pdf, which gets saved in a seperate Folder, gets opened.

So i have the ID 18. (in the form in Access)

In the Folder M:FBGrimmSuW was saved the contract with the Name:

Mietvertrag18.

I've created the following code, but it doesn't work.

Code:
Private Sub Befehl4065_Click()
Dim sPath As String
sPath = "M:FBGrimmSuW" & "Mietvertrag" & Me.MietvertragsnummerID & ".pdf"
End Sub

View 2 Replies View Related







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