473,382 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Multiline address block in ms access 2013 using a query

I have a table with address field and want to have a multi line address block on a form and report. What is the code in a string for line return. Example

First name surname
Address 1
Addess2
Town
County
Post code
May 20 '15 #1
6 3325
zmbd
5,501 Expert Mod 4TB
Shute112:
How is your data stored?

In a single field like:
[First name surname Address 1 Addess2 Town County Post code]

or in a table like:

[First name][surname][Address 1][Addess2][Town][County][Post code]

In the first case you will need to code a function to split out your data. I also highly advise you to redesign your database in this case.

In the second case, place the fields on your report in the desired positions.
May 20 '15 #2
Hi ZMBD

Thanks for coming back to me so quickly. The table consists of separate fields for the name address etc. I have jointed the fields together into one string.

Addr: (+[HouseName]+",") & " " & (+[Address]+", ") & (+[Area]+", ") & (+[Town] & ", ") & [County] & ", " & [Postcode]

but would like to see the address in separate lines like an envelope is addressed. Is there a code to go between the fields to have a line break.

Currently the address appears in one long line and not multiable lines as I indicated in my question. The problem with placing the fields separately onto the report if the customer has not a house name or only one line of address there is a blank space.

Hope this makes sense.

Mike
May 20 '15 #3
Seth Schrock
2,965 Expert 2GB
Instead of concatenating the comma into the string, add Chr(13) & Chr(10)
May 20 '15 #4
Hi Seth

I have tried your Chr(10) but cannot get it to work. Can you please look at the string and see where I should be adding the Chr(10) and if possible could you type it out and I will copy straight into my query.
Addr: (+[HouseName]+",") & " " & (+[Address]+", ") & (+[Area]+", ") & (+[Town] & ", ") & [County] & ", " & [Postcode]

I added the chr(10) as below. Was I right!!!

Addr: (+[HouseName]+Chr(10)) & " " & (+[Address]+"Chr(10) ") & (+[Area]+"Chr(10) ") & (+[Town] & "Chr(10) ") & [County] & "Chr(10) " & [Postcode]

But this did not work.


Mike
May 20 '15 #5
Seth Schrock
2,965 Expert 2GB
You have to have Chr(13) as well.
Expand|Select|Wrap|Line Numbers
  1. Addr: ([HouseName]+Chr(13)+Chr(10)) & ([Address]+Chr(13)+Chr(10)) & ([Area]+Chr(13)+Chr(10)) & ([Town] +Chr(13)+Chr(10)) & ([County]+Chr(13)+Chr(10)) & [Postcode]
May 20 '15 #6
Thanks Seth
Works well. very grateful.
Mike
May 20 '15 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sasha | last post by:
Hi All, I am new to VB.Net and am having a problem with the below code. I am trying to fill in a datagrid with the below query but it keeps giving me error where the *'s are located below. I...
2
by: dollyvishal | last post by:
How to get constraint information for MS Access tables using Query?
0
by: steveradaza | last post by:
Sir,Good Day..I am a newbie here and i am just learning the usage of microsoft access..can you help me solve my problem in making a running balance in a query of microsoft access 2013 of my In and...
4
by: nomeepk | last post by:
hi, i am using access 2013, Is there a way i can make this Access Database online, so i can access and use it from anywhere in a Browser? Regards.
5
by: jimatqsi | last post by:
I'm looking for information about compatibility between Access 2013 and Access 2003. I've been approached by a firm that wants to begin upgrading their systems. I want to know if it is reasonable...
0
by: LeoVBNET | last post by:
Hi Because VS 2013 dropped SQL COMPACT databases, I need to convert Access 2013 databases into SQL COMPACT in order to be able to use Linq to SQL in VB 2013. Anybody can help me? Thanks
6
by: GKJR | last post by:
I have been using Access 2013 (in Office 365) with Windows 8.1 for about a month and a half now. I was a little reluctant to switch from 2010 on Windows 7, but I figured I should try stay ahead of...
1
by: Goss | last post by:
I have added to the query criteria, and the query runs fine, but when I open the Chart in print view the input box asks me for the month 3 times? any ideas
6
by: msilva100 | last post by:
Hello, I need to have remote access to a MS Access 2013 Database running on a Windows 7 Server. Can someone kindly recommend a remote access tool? Thank you.
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.