Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Forums > Access
Back to Access Forum    Comments List
Multivalued field Upload Images   Link   Email  
Harold Laski 
I have a customer table called CustomerT and a query called CustomerQ. I tried to create the following: Customer: [FirstName] & " " & [MI] & " " & [LastName] it worked fine. But as soon as I added the [Suffix] it gave me an error message that [Suffix] is a multivalued field and cannot be used. This is what got me the error message. Customer: [FirstName] & " " & [MI] & " " & [LastName] & " " & [Suffix]. Why is Suffix a multivalued field?
Harold Laski 
Thinking on it I assume that means that Suffix uses a drop-down menu for Jr., Sr., I, II, III.    So if it is a multivalued field how do I use it to create the Customer: [FirstName] & " " & [MI] & " " & [LastName] & " " & [Suffix]
Adam Schwanz 
You shouldn't use multivalued fields. :P Evil Access Stuff
Adam Schwanz 
How many columns are in suffix and what is the bound column?
Scott Axton 
Harold is the field a MultiValued Field?
Go into design mode and look at the Suffix properties --> lookup
Look for Allow Multiple Values

Sounds like you set up your lookup incorrectly.
We might need to recreate that lookup but lets find out first.
Kevin Yip 
Your [suffix] field is a multivalue field.  A multivalue field is not a string, so that's why you can't use string concatenation such as [firstname] & " " & [lastname] & " " [suffix].

A multivalue field contains several values within, and each value is accessed with the .Value property.  E.g. [suffix].[Value]

If you use the query below, it will work, but it will not give you the result you want:

SELECT [firstname] & " " & [lastname] & " " [suffix].[Value] As fullname FROM MyTable

Instead of "John Doe Jr. Esq. MD.", the query above will yield:
John Doe Jr.
John Doe Esq.
John Doe MD.

In order to get "John Doe Jr. Esq. MD.", you have to use VBA to "loop" through all the values within the multivalue field in order to access all the values in the suffix.

This is one of many reasons why multivalue fields are to be avoided.  It's a badly implemented feature in Access.  But I've seen it implemented well in other database environment.

If you go to table design and remove "Allow multiple values", you will lose all your data.

A much better way to store multiple suffices is to store them in an actual table separately, and link it to the first name-last name table in a one-to-many relationship.  You still would have to use a recordset loop to get all suffices in a string, but you wouldn't have the headaches of a multivalue field.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 3/28/2024 8:42:36 AM. PLT: 1s