473,657 Members | 3,021 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

To have a field name altered

Roy
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,

Roy

Oct 10 '07 #1
3 1496
Roy wrote:
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,

Roy
If it can't be done via the Export, you can always write out the file
easily enough and do whatever you want.

See Open, Print, Put, Write, Close in help.
Oct 10 '07 #2
Roy
On Oct 10, 2:42 pm, Salad <o...@vinegar.c omwrote:
Roy wrote:
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,
Roy

If it can't be done via the Export, you can always write out the file
easily enough and do whatever you want.

See Open, Print, Put, Write, Close in help.
is it possible to elaborate on this,any example?

Thanks,

Roy

Oct 10 '07 #3
Roy wrote:
On Oct 10, 2:42 pm, Salad <o...@vinegar.c omwrote:
>>Roy wrote:
>>>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,thi s (.) period is eliminated while importing.He wants the
period to appear on the field name in the export file.Is this
possible?
>>>Thanks,
>>>Roy

If it can't be done via the Export, you can always write out the file
easily enough and do whatever you want.

See Open, Print, Put, Write, Close in help.


is it possible to elaborate on this,any example?

Thanks,

Roy
I don't know if this will create a "true" command delimited file....it
puts quotes around everything. Change the output filename and the
recordset and run a test. In the header/col part you'd check to see if
the name is "Dept" and change it to "Dept."
Sub PrintTest()
Dim strFile As String
Dim rst As Recordset
Dim intFor As Integer
Dim intRst As Integer
Dim strOut As String
Dim Quote As String

Quote = Chr(34)

'Change the output name
strFile = "C:\Junk\Junk.T xt"
Open strFile For Output As #1

'Change to your table name
Set rst = CurrentDb.OpenR ecordset("Table 1")

'print column headers and first 5 records
For intFor = 0 To 5
strOut = ""
If intFor = 0 Then
'create the header/column name line
For intRst = 0 To rst.Fields.Coun t - 1
strOut = strOut & Quote & rst(intRst).nam e & Quote & ","
Next
Else
'create the data lines
For intRst = 0 To rst.Fields.Coun t - 1
strOut = strOut & _
Quote & rst(intRst).Val ue & Quote & ","
Next
End If

strOut = Left(strOut, Len(strOut) - 1)
Print #1, strOut

rst.MoveNext
Next

Close #1

rst.Close
Set rst = Nothing
End Sub
Oct 10 '07 #4

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

Similar topics

3
4738
by: dhowell | last post by:
I have a form that has two sub forms. I would like to use the current value of one of the subform fields as a search parameter in a query. I tried pointing to the name of the form/field within the query, but it didn't use the current field value as the search criteria......I get the pop up Dialog that says "Enter Parameter Value"...... I'm not sure what I'm doing wrong.
14
5496
by: Larry R Harrison Jr | last post by:
I have designed databases but have never come across any complications due to the ridiculous situation of a hyphenated last name. As a database designer (very junior level) I disdain anything unwieldly, and consider this unwieldly. I haven't dealt with it, as I said, but I figure if I do, I'd simply design the text field to not accept hyphens, so Smith-Barney would be stored as SmithBarney, or even Smithbarney as I commonly have the...
3
4105
by: Kevin Rollo | last post by:
I'm playing with a generic routine to export data, the concept is to have a list of data driven templates defining what fields to output. Evaluating a simple variable field name in the function is easily achieved by something like dim rst as dao.recordset .... strField = "Amount" debug.print rst.fields(strField) ' or just rst(strField)
3
1748
by: prabhukumarasamy | last post by:
Now i m working in a existing project. I have to do some updations. In that project database table contain a table(usergroups) field name as 'Name'. When i am trying to insert a new record in (usergoups) table like as follows' insert into UserGroups(Name,modusr,moddt) values ('sam',131,'7/23/2006 10:02:13 PM')
9
3109
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to be inserted into a standard web address in the table (the filed name is link) in ddw1 Example address ---
2
1524
by: Izod | last post by:
I'm new, hope I describe my dilemma ok. I've got a large DB from the County. They have the "house Number" in the same field as the Street Name. It is always the 1st 4 characters followed by a space. I need to grab the House number and put it in it's own field as well as removing it from it's existing field. What software that works with DB allows me to do that? Any help appreciated. --
2
2622
by: charleythomas | last post by:
Hi, Allen Browne's "Field-level Permissions in Microsoft Access" (http:// allenbrowne.com/ser-55.html) is an excellent sample db i was looking for a long time. Am using Access2000. I have multiple databases for which i require different field level permissions. I will put my question simple. Does anyone know how to modify this db in such a way that i can specify the Windows User Name against the table fields to block or unblock. I have...
10
1499
by: Rob | last post by:
I am reading a book that says that the "name" property can be altered only at design time and cannot be modified at runtime. Please explain this given the code below... If you click Button3... fred will appear as the Name of Button1, however, the handler for Button1 works still works as well... Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
15
7356
by: sara | last post by:
I have a Memo field in a table to hold notes from a conversation a social worker has had with a client (this is for a non-profit). If the user needs to update the memo field, I need to find the original record (which I am doing fine - getting the correct key) and I need to update the "notes" with the new value from the form, which I store in a String Variable. (I've tried storing in a Variant variable; didn't work for me)
0
8384
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...
0
8820
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8718
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8499
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,...
1
6162
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
5630
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();...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
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.