Results 1 to 7 of 7
  1. #1
    Colmans is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Posts
    7

    Adding a new Field

    I am currently making a database and was wondering if it was possible to press a button which automatically creates a new field on a form.
    For example, if it was a restaurant then the customer would make their order by saying their first item and this would be entered via a form. For their second item however, currently i have to fill out a new form but I was wondering if I created an option button and used the correct coding, could a new field be formed so I could enter their second item?
    I am very poorly skilled at Access.
    I hope I make sense!


    Many thanks!

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    No,you don't work that way. The tables are pre-designed so you DONT add new fields.
    you add new records.

  3. #3
    Colmans is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Posts
    7
    So how can I get around the issue?

  4. #4
    Colmans is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Posts
    7
    Quote Originally Posted by ranman256 View Post
    No,you don't work that way. The tables are pre-designed so you DONT add new fields.
    you add new records.
    So how do I get around the issue?

  5. #5
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You need to design your database differently. Instead of having multiple fields for the different items, you only have one field, and then another item number field.
    So, if a person has two items, you would have two records, i.e.

    Code:
    Name    Item Num      Item
    Bob         1         Salad
    Bob         2         Salmon
    ...
    So your button would create a new record, not a new field.

    Note that this is a "Normalized" database design, which should always be your goal. Normalized databases are much easier to work with.

    For example, let's say that you had ten item fields. And someone asked you to find all the people who ordered Salmon. You would need to search 10 different fields, which is ugly and a lot of unnecessary work. As opposed to just having to search one field.

    Here is a link on Normalization: https://support.microsoft.com/en-us/kb/283878
    There are many others out there on the web.

  6. #6
    Colmans is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Posts
    7
    Quote Originally Posted by JoeM View Post
    You need to design your database differently. Instead of having multiple fields for the different items, you only have one field, and then another item number field.
    So, if a person has two items, you would have two records, i.e.

    Code:
    Name    Item Num      Item
    Bob         1         Salad
    Bob         2         Salmon
    ...
    So your button would create a new record, not a new field.

    Note that this is a "Normalized" database design, which should always be your goal. Normalized databases are much easier to work with.

    For example, let's say that you had ten item fields. And someone asked you to find all the people who ordered Salmon. You would need to search 10 different fields, which is ugly and a lot of unnecessary work. As opposed to just having to search one field.

    Here is a link on Normalization: https://support.microsoft.com/en-us/kb/283878
    There are many others out there on the web.
    Thank you!

  7. #7
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You are welcome!

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

Similar Threads

  1. Replies: 7
    Last Post: 10-19-2016, 11:11 AM
  2. Replies: 3
    Last Post: 07-01-2016, 08:11 AM
  3. Replies: 4
    Last Post: 02-03-2016, 09:23 PM
  4. Replies: 2
    Last Post: 03-30-2012, 07:39 AM
  5. Replies: 10
    Last Post: 04-21-2010, 01:16 PM

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
  •  
Other Forums: Microsoft Office Forums