Results 1 to 7 of 7
  1. #1
    kelvinkind is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2014
    Posts
    6

    product with mutiple colors

    Hi Guys,



    This is Kelvin and I am new to this access.

    I was creating a access web app for my company and want to create a data for its product. Each product will have multiple colors and different material are used for each color. The number of colorways for a product varies.

    We want to be able to select a product and a lookup field will appears for us to choose its colorway.

    Can you guys kindly give me some hints on what structure in should use for data like this?


    Thanks in advance.
    Kelvin

  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
    50,422
    Sounds like you want dependent (cascading) comboboxes. Review: http://www.datapigtechnologies.com/f...combobox2.html
    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
    kelvinkind is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2014
    Posts
    6
    Thank you so much!

    This would be what I want to form to look like. However, to do this, I will have to create a field for each color. If a product have 10 colors, I will need to create 10 records that link to that style.

    Is there a more elegant way to do this?

    Many Thanks,
    Kelvin

  4. #4
    kelvinkind is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2014
    Posts
    6
    In additional I wonder if we can use a "set field" Macro to set a value in a lookup field?

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    50,422
    Don't understand why you would need a field for each color.

    Don't understand what you mean by 'set a value in a lookup field'.
    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.

  6. #6
    kelvinkind is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2014
    Posts
    6
    Hi Moderator,

    Kindly see below:
    Click image for larger version. 

Name:	Access.jpg 
Views:	8 
Size:	207.5 KB 
ID:	16995

    The button works ok except for the "Factory Reference Field". When I use the set field function below:
    Parameter:
    FR = [Factory_ReferenceTextBox]

    set field
    Name colorway.factory reference
    Value = [FR]

    When I press the button It said "You cannot add or change a record because a related record is required in table Products."

    Can you kindly give me a hints on how to solve this problem? Or I am using a wrong structure all along?

    Thanks in Advance.

    Kelvin

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    50,422
    The error seems rather self-explanatory. The Colorway table has a FK field for product. You are attempting to enter a product that isn't found in the products table. If you need to be able to add records to a lookup table 'on-the-fly' during data entry, that's what the combobox NotInList event is for.

    Beyond that, I am not quite following the data structure.
    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.

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

Similar Threads

  1. Need help with colors in my form
    By Kliq in forum Database Design
    Replies: 3
    Last Post: 03-29-2014, 03:53 PM
  2. Replies: 4
    Last Post: 04-26-2013, 08:32 AM
  3. Replies: 3
    Last Post: 02-26-2013, 05:07 AM
  4. mutiple joins
    By mothermugger in forum Queries
    Replies: 1
    Last Post: 11-15-2011, 04:06 PM
  5. Pie Chart Colors!
    By dannyowl in forum Access
    Replies: 0
    Last Post: 05-12-2010, 09:30 AM

Posting Permissions

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