MS Access Reports- Setting up a Address from SSMS

Hi Experts,

I have this:
([Label5] + "") & ([Label6] + "") & ([City] + "") & ([State] + "") & ([ZipCode] + '') & ([Country] + "")

Open in new window


Just checking if this is correct for the Control Source, it comes from SSMS Stored Procedure?

Thanks for any help...
Amour22015Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Assuming you have the Label controls and all those fields on your Report, it should work.
0
Gustav BrockCIOCommented:
It seems of no purpose to me:

    ([Label6] + "") returns Null if Label6 is Null, and the content of Label6 if it is not Null.

So does:

    Label6

on its own as well.

So a lot of code for nothing.

/gustav
0
Amour22015Author Commented:
The reason is that it is looking for not any of the fields to be blank

Example:
([Label5] + "") & ([Label6] + "") & ([City] + "") & ([State] + "") & ([ZipCode] + '') & ([Country] + "")
Label5 = 999 Best Street
Label6 = Blank
City = Washington
State = DC
Zipcode = Blank
Country = US

So label6 And Zipcode would be blank causing a 2 large blanks in the string.
999 Best Street                Washington DC                 US

It would need to look like:
999 Best Street Washington DC US

So I need to look for any blanks/nulls?

Thank for helping....
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Gustav BrockCIOCommented:
But it doesn't work that way:

([Label5] + "") & ([Label6] + "") & ([City] + "")

will return:

? ("999 Best Street" + "") & (Null + "") & ("Washington" + "")
999 Best StreetWashington

So will:

[Label5] & [Label6] & [City]

? "999 Best Street" & Null & "Washington"
999 Best StreetWashington

What you have in mind is probably:

([Label5] + " ") & ([Label6] + " ") & ([City] + " ")

? ("999 Best Street" + " ") & (Null + " ") & ("Washington" + " ")
999 Best Street Washington

/gustav
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Amour22015Author Commented:
So I just needed to space "" to " " ok thanks....
0
Gustav BrockCIOCommented:
Yes - and you wouldn't need it for the very last field.

/gustav
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.