By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,829 Members | 1,829 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,829 IT Pros & Developers. It's quick & easy.

Changing name of export file

P: n/a
In Access 97 I made an application that makes text files that are
exported.
The names of the files contain two variables:
1. the value of the field BRIN in a table VasteGegevens of my
database.
2. the sequence number.

So for instance, the export file may be called Bron02AP003.txt, where
Bron is a fixed text, BRIN has the value 02AP and it is the third file
of this kind.

I made a button "KnopTest" in the form which renames the initial file
BRONaaaabbb.txt with the following code:
Private Sub KnopTest_Click()
On Error GoTo Err_KnopTest_Click
Dim Waarde As String
Waarde= "C:\BRON\Bron" & DFirst("[BRIN]", "VasteGegevens")
&DMax("[Nummer]","Volgnummers")+1&".txt"
Name "C:\BRON\BRONaaaabbb.txt" As Waarde
Exit_KnopTest_Click:
Exit Sub
Err_KnopTest_Click:
MsgBox Err.Description
Resume Exit_KnopTest_Click
End Sub
But it does not work! Any suggestions?

Thanks!

Roel Schoonveld
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"It does not work" isn't much for us to go on. What exactly does (or
doesn't) happen?

What value is being stored in Waarde? Is that what it should be?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"Roel Schoonveld" <ro**@schoonveld.com> wrote in message
news:c6**************************@posting.google.c om...
In Access 97 I made an application that makes text files that are
exported.
The names of the files contain two variables:
1. the value of the field BRIN in a table VasteGegevens of my
database.
2. the sequence number.

So for instance, the export file may be called Bron02AP003.txt, where
Bron is a fixed text, BRIN has the value 02AP and it is the third file
of this kind.

I made a button "KnopTest" in the form which renames the initial file
BRONaaaabbb.txt with the following code:
Private Sub KnopTest_Click()
On Error GoTo Err_KnopTest_Click
Dim Waarde As String
Waarde= "C:\BRON\Bron" & DFirst("[BRIN]", "VasteGegevens")
&DMax("[Nummer]","Volgnummers")+1&".txt"
Name "C:\BRON\BRONaaaabbb.txt" As Waarde
Exit_KnopTest_Click:
Exit Sub
Err_KnopTest_Click:
MsgBox Err.Description
Resume Exit_KnopTest_Click
End Sub
But it does not work! Any suggestions?

Thanks!

Roel Schoonveld

Nov 12 '05 #2

P: n/a
DFS

"Roel Schoonveld" <ro**@schoonveld.com> wrote in message
news:c6**************************@posting.google.c om...
In Access 97 I made an application that makes text files that are
exported.
The names of the files contain two variables:
1. the value of the field BRIN in a table VasteGegevens of my
database.
2. the sequence number.

So for instance, the export file may be called Bron02AP003.txt, where
Bron is a fixed text, BRIN has the value 02AP and it is the third file
of this kind.

I made a button "KnopTest" in the form which renames the initial file
BRONaaaabbb.txt with the following code:
Private Sub KnopTest_Click()
On Error GoTo Err_KnopTest_Click
Dim Waarde As String
Waarde= "C:\BRON\Bron" & DFirst("[BRIN]", "VasteGegevens")
&DMax("[Nummer]","Volgnummers")+1&".txt"
Name "C:\BRON\BRONaaaabbb.txt" As Waarde
Exit_KnopTest_Click:
Exit Sub
Err_KnopTest_Click:
MsgBox Err.Description
Resume Exit_KnopTest_Click
End Sub
But it does not work! Any suggestions?

You don't need the line: Name "C:\BRON\BRONaaaabbb.txt" As Waarde

In fact, it should throw an error.

Thanks!

Roel Schoonveld

Nov 12 '05 #3

P: n/a
Thank you all! I found out that I just mistyped a command. Stupid me!
Roel

"DFS" <no****@nospam.com> wrote in message news:<10*************@corp.supernews.com>...
"Roel Schoonveld" <ro**@schoonveld.com> wrote in message
news:c6**************************@posting.google.c om...
In Access 97 I made an application that makes text files that are
exported.
The names of the files contain two variables:
1. the value of the field BRIN in a table VasteGegevens of my
database.
2. the sequence number.

So for instance, the export file may be called Bron02AP003.txt, where
Bron is a fixed text, BRIN has the value 02AP and it is the third file
of this kind.

I made a button "KnopTest" in the form which renames the initial file
BRONaaaabbb.txt with the following code:
Private Sub KnopTest_Click()
On Error GoTo Err_KnopTest_Click
Dim Waarde As String
Waarde= "C:\BRON\Bron" & DFirst("[BRIN]", "VasteGegevens")
&DMax("[Nummer]","Volgnummers")+1&".txt"
Name "C:\BRON\BRONaaaabbb.txt" As Waarde
Exit_KnopTest_Click:
Exit Sub
Err_KnopTest_Click:
MsgBox Err.Description
Resume Exit_KnopTest_Click
End Sub
But it does not work! Any suggestions?

You don't need the line: Name "C:\BRON\BRONaaaabbb.txt" As Waarde

In fact, it should throw an error.

Thanks!

Roel Schoonveld

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.