Group:  Microsoft Access ยป microsoft.public.access.modulescoding
Thread: Folder Naming from Access

Geek News

Folder Naming from Access
Janet A. Thompson 11/14/2008 5:15:23 AM
How would you get the computer to take the names from a column in Access
table and open a folder of pdfs and rename the pdfs using the sequential
names in the Access table?

--
Janet A.
Re: Folder Naming from Access
Stefan Hoffmann <ste5an[ at ]ste5an.de> 11/14/2008 9:53:59 AM
hi Janet,

Janet A. Thompson wrote:
[Quoted Text]
> How would you get the computer to take the names from a column in Access
> table and open a folder of pdfs and rename the pdfs using the sequential
> names in the Access table?
Take a look at the VBA Name() procedure:

Dim OldFileName As String
Dim NewFileName As String

OldFileName = "C:\MyFile.txt"
NewFileName = "C:\Text1.txt"
Name OldFileName As NewFileName




mfG
--> stefan <--
Re: Folder Naming from Access
Janet A. Thompson 11/15/2008 2:18:01 AM
So knowing not too much about VB, where would the code go?
--
Janet A.


"Stefan Hoffmann" wrote:

[Quoted Text]
> hi Janet,
>
> Janet A. Thompson wrote:
> > How would you get the computer to take the names from a column in Access
> > table and open a folder of pdfs and rename the pdfs using the sequential
> > names in the Access table?
> Take a look at the VBA Name() procedure:
>
> Dim OldFileName As String
> Dim NewFileName As String
>
> OldFileName = "C:\MyFile.txt"
> NewFileName = "C:\Text1.txt"
> Name OldFileName As NewFileName
>
>
>
>
> mfG
> --> stefan <--
>
Re: Folder Naming from Access
Stefan Hoffmann <ste5an[ at ]ste5an.de> 11/15/2008 1:49:01 PM
hi Janet,

Janet A. Thompson wrote:
[Quoted Text]
> So knowing not too much about VB, where would the code go?
How is your table defined?


mfG
--> stefan <--
Re: Folder Naming from Access
Janet A. Thompson 11/15/2008 3:52:01 PM
I did not create the access table. I can look at the table he created and
open the t VB window via F11+ Alt. Is that where the code would go?




b"Stefan Hoffmaut nn" wro
[Quoted Text]
> hi Janet,
>
> Janet A. Thompson wrote:
> > So knowing not too much about VB, where would the code go?
> How is your table defined?
>
>
> mfG
> --> stefan <--
>
Re: Folder Naming from Access
Stefan Hoffmann <ste5an[ at ]ste5an.de> 11/16/2008 8:51:51 PM
hi Janet,

Janet A. Thompson wrote:
[Quoted Text]
> So knowing not too much about VB, where would the code go?
Create a new form, assign your table to it. Place a button on your form,
name ir cmdMyButton. Create an event procedure:

Private Sub cmdMyButton_Click()

On Local Error GoTo LocalError

Name Me![OldFileName] As Me![NewFileName]

Exit Sub

LocalError:
MsgBox "Error: " & Err.Description

End Sub

Replace OldFileName and NewFileName with the correct names of your fields.

Backup your files first.

mfG
--> stefan <--
Re: Folder Naming from Access
Janet A. Thompson 11/17/2008 3:46:01 AM
Oh wow. I'll try this tomorrow.

So, I'm thinking you use a button on a form for other document manipulations
too. Just change out the code. hmmm

Wonderful!--
Janet A.


"Stefan Hoffmann" wrote:

[Quoted Text]
> hi Janet,
>
> Janet A. Thompson wrote:
> > So knowing not too much about VB, where would the code go?
> Create a new form, assign your table to it. Place a button on your form,
> name ir cmdMyButton. Create an event procedure:
>
> Private Sub cmdMyButton_Click()
>
> On Local Error GoTo LocalError
>
> Name Me![OldFileName] As Me![NewFileName]
>
> Exit Sub
>
> LocalError:
> MsgBox "Error: " & Err.Description
>
> End Sub
>
> Replace OldFileName and NewFileName with the correct names of your fields.
>
> Backup your files first.
>
> mfG
> --> stefan <--
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net