473,805 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB to Clean up Long Ship To Address

I am using bar tender hooked up to a MS Access DB to print labels. I
have a problem with the Access table. The problem is that the "Ship
to" field is written like this:

Warehouse "adidas, Ltd." /142181, MOSKOVSKAYA OBLAST,/KLIMOVSK,
BEREGKOVSKYI/PROEZD 17-A 38290

I need it formated like this:

Warehouse "adidas, Ltd."
142181, MOSKOVSKAYA OBLAST,
KLIMOVSK, BEREGKOVSKYI/PROEZD 17-A 38290

My question is, how can I break this up. I can add columns to my DB
as

address 1
address 2
address 3
and so on, but I need to be able to read between the "/". Also,
bartender as a spot for VB, so I may be able to break it up inside the
app. But I still don't know how to read only between the "/".

May 1 '07 #1
3 1736
A cheap and dirty way!

Export the address database to word doc.
Import it as a coma delimited file.

I am sure there are Access Gurus here who can offer you professional advice,
bypassing my primitive solution.

--
Jim Hagani
QA Manager
TFC Manufacturing
P: (562) 426-9559
F: (562) 426-9717
jh*****@tfcmfg. com
"Starke" <st********@hot mail.comwrote in message
news:11******** **************@ c35g2000hsg.goo glegroups.com.. .
>I am using bar tender hooked up to a MS Access DB to print labels. I
have a problem with the Access table. The problem is that the "Ship
to" field is written like this:

Warehouse "adidas, Ltd." /142181, MOSKOVSKAYA OBLAST,/KLIMOVSK,
BEREGKOVSKYI/PROEZD 17-A 38290

I need it formated like this:

Warehouse "adidas, Ltd."
142181, MOSKOVSKAYA OBLAST,
KLIMOVSK, BEREGKOVSKYI/PROEZD 17-A 38290

My question is, how can I break this up. I can add columns to my DB
as

address 1
address 2
address 3
and so on, but I need to be able to read between the "/". Also,
bartender as a spot for VB, so I may be able to break it up inside the
app. But I still don't know how to read only between the "/".

May 1 '07 #2
You will have to do a little bit of programming - something like this:

Dim DB As DAO.Database, RS As DAO.Recordset, str1() As String, i As
Integer

Set DB = CurrentDB
Set RS = DB.OpenRecordSe t("yourTbl")
Do While Not RS.EOF
str1 = Split(RS!Addres s, "/")
For i = 0 To Ubound(str1)
Debug.Print(str 1(i)
Next
RS.MoveNext
Loop

Whenever you have delimeters, you can use the Split function to convert
the string containing the delimeters into an array of string. Then you
can get the desired format. In your report you would place code similar
to this in the Report Section of the Report Code Module:

Note: make the variables module level vars (declare at the top of the
module)

Private Sub Report_Open(Can cel As Integer)
Set DB = CurrentDB
Set RS = DB.OpenRecordSe t("yourTbl")
End Sub

then in the Detail section you could do something like this:

Private Sub Detail_Format(C ancel As Integer, FormatCount As Integer)
str1 = split(RS!Addres s, "/")
txt0 = str1(0)
txt1 = str1(1)
txt2 = str1(2)

RS.MoveNext
End Sub

Good Luck

Rich

*** Sent via Developersdex http://www.developersdex.com ***
May 1 '07 #3
On 1 May 2007 11:32:00 -0700, Starke <st********@hot mail.comwrote:

select Replace(ShipTo, "/", Chr$(13) & Chr$(10)) from SomeTable

-Tom.
>I am using bar tender hooked up to a MS Access DB to print labels. I
have a problem with the Access table. The problem is that the "Ship
to" field is written like this:

Warehouse "adidas, Ltd." /142181, MOSKOVSKAYA OBLAST,/KLIMOVSK,
BEREGKOVSKYI/PROEZD 17-A 38290

I need it formated like this:

Warehouse "adidas, Ltd."
142181, MOSKOVSKAYA OBLAST,
KLIMOVSK, BEREGKOVSKYI/PROEZD 17-A 38290

My question is, how can I break this up. I can add columns to my DB
as

address 1
address 2
address 3
and so on, but I need to be able to read between the "/". Also,
bartender as a spot for VB, so I may be able to break it up inside the
app. But I still don't know how to read only between the "/".
May 2 '07 #4

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

Similar topics

8
4993
by: Craig Thomson | last post by:
I was wondering what people do with text provided by the user in a form. Some cleaning needs to be done at some stage if you are going to be putting it in a database or displaying it etc. But when is the time to do that? Do you clean it as soon as you get it? Do you pass around the original text and clean it when you use it? What about magic slashes? You need to addslashes before using in a db statement, but you need to strip them...
0
2728
by: Bill Davy | last post by:
I am working with MSVC6 on Windows XP. I have created an MSVC project called SHIP I have a file SHIP.i with "%module SHIP" as the first line (file is below). I run SHIP.i through SWIG 1.3.24 to obtain SHIP_wrap.cpp and SHIP.py; the latter contains the line "import _SHIP". I compile SHIP_wrap.cpp and a bunch of files into a DLL which I have the
45
3759
by: Curt Geske | last post by:
I'm suprised no one suggested a union! #include <stdio.h> union _x { long lng; char byt; } X; void main( void )
16
9966
by: Blue Apricot | last post by:
X-No-Archive How long will Classic ASP be supported by Microsoft? Should I start learning ASP.NET? Is it hard if you already know ASP? Blue Apricot
5
1576
by: Rob R. Ainscough | last post by:
I have a moderately sized web application (30 pages, and 20 DLLs) that takes 10-20 minutes to "Build Solution" after I do a "Clean Solution" -- this is ONLY apparent after a "Clean Solution" I have a reasonably power workstation (3.06Ghz dual Zeon with 4GB RAM and 10K RPM hard drives) -- this problem ONLY occurs immediately after I do a Clean Solution and then "Build Solution" -- if I just run Build Solutions (one after another) it only...
2
4567
by: Ronald | last post by:
I just started with dotnetnuke, and with a wrong login (wrong password on a clean install i can crash the application pool from IIS. (when i login with the right username/password information the site works fine, i can do anything it is supposed to do) I have the following setup: -Windows 2003 x64 (fully patched, clean install) -Dotnetframework 2.0.50727 -Dotnetnuke 4.3.1
4
1914
by: Jeeran | last post by:
We use an ISAPI filter to convert long urls into short clean ones. For example: "Site.com/user/john/" Is re-written as: "Site.com/user/userinfo.aspx?uid=john" Now, "userinfo.aspx" contains a web user control which uses some Atlas functionality; The web user control contains a "DataList" which gets updated asynchronously through Atlas when the user clicks a button –the button is the Atlas trigger.
5
2058
by: basoul | last post by:
I have to make a game with 15 x 26 grid sigular array (array of 390 charecters) and im supose to load the ships which are charecters horozontally. only 4 are needed and the function im stuck on is suppose to load them one at a time. the main requirements are that the ships dont overlap eachother and the random placements make sure that the ship fits on the line and dosent go to the next. what i have rite now is void load_ships(char board,...
232
13384
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first set of examples, after decoding the HTML FORM contents, merely verifies the text within a field to make sure it is a valid representation of an integer, without any junk thrown in, i.e. it must satisfy the regular expression: ^ *?+ *$ If the...
0
9718
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
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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
10368
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
10107
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6876
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
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4327
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
3
3008
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.