Results 1 to 10 of 10

Default value for multivalue field

  1. #1
    lonesoac0 is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Aug 2014
    Posts
    34

    Default value for multivalue field

    Hello all,

    I have created a multivalue field based off of: http://office.microsoft.com/en-us/ac...33722.aspx#BM4 I am getting my values from a different table from within the database. My issue is that I tried to create a default value for the lookup field but it made another selection within the lookup field.

    Example:

    Reference Table Values are:
    Name 1
    Name 2

    Field referencing table with my defined default value:
    Name 1
    Name 2
    Name 1

    What am I doing wrong?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    47,691
    Maybe using multi-value field in the first place - I NEVER use them.

    I just tested multi-value field and combobox and the DefaultValue worked properly.

    Post the RowSource of the combobox and what you put in the DefaultValue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    scottlagger072019 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2019
    Location
    Joliet, IL
    Posts
    3
    Hi,
    I have the exact same question. I am glad your test worked.

    Row Source: SELECT [Security Group].[ID], [Security Group].[Security Group] FROM [Security Group] ORDER BY [Security Group];
    Default Value: =3 And 4 And 5 And 6 And 7 And 9

    I would love to know what I am doing wrong.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,401
    I agree with june, don't use multi value fields, they are a tremendously bad idea.

  5. #5
    scottlagger072019 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2019
    Location
    Joliet, IL
    Posts
    3
    Hi rpeare,

    If you do not use Multivalue fields, what would you use instead?

    I have Roles that match to multiple groups that make up that Role.

  6. #6
    isladogs's Avatar
    isladogs is offline Very idle programmer
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    3,555
    Scott
    Suggest you read this article to understand why most developers strongly recommend not to use multivalued fields: http://www.mendipdatasystems.co.uk/m...lds/4594468763
    There are ALWAYS better ways of doing tasks than MVFs.
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    47,691
    DefaultValue can be only a single value.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    scottlagger072019 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2019
    Location
    Joliet, IL
    Posts
    3
    OK. I read the article but it has no suggestion on how to do it the right way. I will just leave it as is for now.

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    47,691
    Instead of multi-value field, we are suggesting you have a related dependent table (this was advised in the Conclusions section of referenced article). This is actually what Access does with MVF but hides the dependent table. The multi-value field is really a pointer to records in hidden table.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    isladogs's Avatar
    isladogs is offline Very idle programmer
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    3,555
    As June stated, the conclusion section of my article advised you how to do it.
    If you leave it as it is, I'm sure you will regret it later
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Simulating Multivalue field in form display
    By tom.hampton in forum Forms
    Replies: 7
    Last Post: 02-01-2014, 04:57 PM
  2. Multivalue Field Advice
    By Leonidsg in forum Database Design
    Replies: 18
    Last Post: 04-30-2013, 07:40 PM
  3. Simulating a Multivalue Field
    By EddieN1 in forum Database Design
    Replies: 3
    Last Post: 12-12-2011, 10:57 AM
  4. Multivalue field sort order
    By bdaun in forum Forms
    Replies: 0
    Last Post: 09-05-2011, 12:27 PM
  5. Append into multivalue field help
    By iwantatransam in forum Import/Export Data
    Replies: 0
    Last Post: 04-26-2011, 08:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums