473,503 Members | 1,748 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 1487
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.comwrote:
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.comwrote:
>>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
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.Txt"
Open strFile For Output As #1

'Change to your table name
Set rst = CurrentDb.OpenRecordset("Table1")

'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.Count - 1
strOut = strOut & Quote & rst(intRst).name & Quote & ","
Next
Else
'create the data lines
For intRst = 0 To rst.Fields.Count - 1
strOut = strOut & _
Quote & rst(intRst).Value & 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
4728
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...
14
5484
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...
3
4097
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...
3
1742
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...
9
3095
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...
2
1511
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...
2
2613
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...
10
1489
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......
15
7320
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...
0
7188
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,...
0
7258
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,...
1
6970
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...
0
7441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4987
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...
0
3156
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...
0
1489
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 ...
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
366
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...

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.