473,809 Members | 2,687 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing name of export file

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_Cl ick
Dim Waarde As String
Waarde= "C:\BRON\Br on" & DFirst("[BRIN]", "VasteGegevens" )
&DMax("[Nummer]","Volgnummers" )+1&".txt"
Name "C:\BRON\BRONaa aabbb.txt" As Waarde
Exit_KnopTest_C lick:
Exit Sub
Err_KnopTest_Cl ick:
MsgBox Err.Description
Resume Exit_KnopTest_C lick
End Sub
But it does not work! Any suggestions?

Thanks!

Roel Schoonveld
Nov 12 '05 #1
3 2064
"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**@schoonvel d.com> wrote in message
news:c6******** *************** ***@posting.goo gle.com...
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_Cl ick
Dim Waarde As String
Waarde= "C:\BRON\Br on" & DFirst("[BRIN]", "VasteGegevens" )
&DMax("[Nummer]","Volgnummers" )+1&".txt"
Name "C:\BRON\BRONaa aabbb.txt" As Waarde
Exit_KnopTest_C lick:
Exit Sub
Err_KnopTest_Cl ick:
MsgBox Err.Description
Resume Exit_KnopTest_C lick
End Sub
But it does not work! Any suggestions?

Thanks!

Roel Schoonveld

Nov 12 '05 #2
DFS

"Roel Schoonveld" <ro**@schoonvel d.com> wrote in message
news:c6******** *************** ***@posting.goo gle.com...
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_Cl ick
Dim Waarde As String
Waarde= "C:\BRON\Br on" & DFirst("[BRIN]", "VasteGegevens" )
&DMax("[Nummer]","Volgnummers" )+1&".txt"
Name "C:\BRON\BRONaa aabbb.txt" As Waarde
Exit_KnopTest_C lick:
Exit Sub
Err_KnopTest_Cl ick:
MsgBox Err.Description
Resume Exit_KnopTest_C lick
End Sub
But it does not work! Any suggestions?

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

In fact, it should throw an error.

Thanks!

Roel Schoonveld

Nov 12 '05 #3
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.sup ernews.com>...
"Roel Schoonveld" <ro**@schoonvel d.com> wrote in message
news:c6******** *************** ***@posting.goo gle.com...
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_Cl ick
Dim Waarde As String
Waarde= "C:\BRON\Br on" & DFirst("[BRIN]", "VasteGegevens" )
&DMax("[Nummer]","Volgnummers" )+1&".txt"
Name "C:\BRON\BRONaa aabbb.txt" As Waarde
Exit_KnopTest_C lick:
Exit Sub
Err_KnopTest_Cl ick:
MsgBox Err.Description
Resume Exit_KnopTest_C lick
End Sub
But it does not work! Any suggestions?

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

In fact, it should throw an error.

Thanks!

Roel Schoonveld

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
14426
by: Jamie A. Landers | last post by:
I have a macro that runs to export a report. It dumps a report on the server in RTF format. Here's the problem that I am having. I would like for the report to have a custom file name daily, like maybe the date. I do not write VB code, so I'm reliant on Access macros. In the export path, you type the path and file name so that the macro knows where to dump the file. There is not a "build" option in this box. Does anyone know a work around...
1
2142
by: fresh | last post by:
I have a database that I periodically export to a text file for a Word mail merge. I have a query that finds all of the records with a null export date and a query that updates the export date to now(). I have a macro that runs the first query, uses TransferText to send it to a file, then runs the update query. However, the file name in TransferText is "hard wired" so whatever was there before gets written over. Is there a way to...
10
15390
by: Marizel | last post by:
I'm not sure there's an easy solution to this, but thought I'd ask. I often find myself with a query which I'd like to reuse, but with a different datasource. These datasources generally have identical field names. The queries select a subset of the fields, so "Select *" is not really an option. Is there an easy way to change the source of a query, either in the design grid or SQL display? I suppose I could copy the SQL into WordPad...
4
3438
by: Anthony Cuttitta Jr. | last post by:
I'm working on some procedures where Access queries are exported to Excel, and then later on, those same workbooks are openned, and I need to target a specific original sheet. Sometimes there will be multiple sheets in the same workbook, sometimes only a single tab. The issue is this: Save query "XLTest - qryExport" to file and the worksheet name becomes "XLTest___qryExport" (three underscores). I have a generic procedure which...
1
3064
by: Bernard Goh | last post by:
Hi All, I am newbie for ASP.NET programming and I am having this error when I tried to print a crytal report from my dotnet web application. Error Message : Invalid file name. at .K(String  , EngineExceptionErrorID  ) at .F(Int16 , Int32 ) at
4
1843
by: andychambers2002 | last post by:
I'm working on a "TempFile" class that stores the data in memory until it gets larger than a specified threshold (as per PEP 42). Whilst trying to implement it, I've come across some strange behaviour. Can anyone explain this? The test case at the bottom starts a TempFile at size 50 and prints its type. It then increases the size to the threshold at which point "self" is changed to being a TemporaryFile. It seems that the next call...
3
1502
by: Roy | last post by:
Hi all, I have a strange request.A client of mine has a data from text file which has to be imported and calculations done.This is fine and works good.But one of the fields is named Dept. with the period.Because of Access,this (.) period is eliminated while importing.He wants the period to appear on the field name in the export file.Is this possible? Thanks,
0
1905
by: sknayeemuddin | last post by:
Hi All, I am migrating the data from DB2 to oracle 10g. while exporting data from DB2 to some external files, i am able to export the data but when i want to export the data with columns name i tried this query( Intending to append the data file with the column file) for data file: 1. db2 'EXPORT TO D:\Exp_files\Exp_Tables\exp_cust_details.csv OF DEL select * from tabschema.tabname for column file: 2. db2 EXPORT TO...
2
4049
by: Marisol2 | last post by:
I have some queries in Access 2003 db that I have setup to display as pivots. I can go into design pivot table view and click on and then click on Export to Office MicroSoft Excel. The problem is I have about 6 queries that produce 48 reports (based on parameters). I don't want to manually save each pivot query results. The first macro I created to export the queries I used TransferSpreadsheet but the export results are regular xls...
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10383
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7661
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.