Results 1 to 4 of 4
  1. #1
    JustWonderful is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    2

    Form with multiple entry fields, only fields with values created as new record in table

    I have a list of 24 unique items in a table. I would like to create a form that lists all 24 items with a blank entry field alongside each one. I would like to be able to enter a value in these blank entry fields for any number of the 24 items, and have each item name and the value I entered be stored as a single entry in a new table. For example: I enter a value for 15 of the 24 items. I click a button and 15 new records are made to a table consisting of the item name and the value that corresponds to it.



    Is there a way for me to create a data entry form this way?

    For more context, I'm tracking my daily habits. I've made a table listing all the habits I want to track. I'd like to be able to record values for multiple habits at once and store them in table (along with the date and time that they were entered).

    Thanks in advance for your help!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Okay, build a table for storing your daily records. Build a form bound to the table. Install controls on form bound to fields. Use a combobox or listbox to select item for saving into record. Textbox for date can have DefaultValue property set to Now() to automatically save the date/time. Move to new record row and create next record.

    Basic relational database structure and Access functionality.

    Your button click idea to create records requires code. The above suggestion does not need any code.

    Have you studied an introductory tutorial book?
    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
    JustWonderful is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    2
    Thank you, but the reason for my post is for assistance going beyond a basic combobox data entry form, to one capable of entering multiple records at once. If it involves code that's fine, I just need a push in the right direction.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Yes, can be done with code but why bother since the user (you are the only user?) is required to do just about as much work. Either way have to do 15 clicks to select items. But if you must and assuming you are the only user, have a yes/no field (IsHabit) in your Habits table then code in button click event like:

    CurrentDb.Execute "INSERT INTO Daily(DtTm, HabitID) SELECT Now() AS DtTm, HabitID FROM Habits WHERE IsHabit"
    CurrentDb.Execute "UPDATE Habits SET IsHabit = False"

    Or instead of the yes/no field, use a multi-select listbox and that requires more complicated code to loop through the listbox selected items, save records, clear the listbox selections.
    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. Entry of multiple date fields in form
    By jegunn in forum Forms
    Replies: 3
    Last Post: 04-02-2015, 02:31 PM
  2. Replies: 2
    Last Post: 11-16-2011, 07:38 PM
  3. Replies: 1
    Last Post: 12-09-2010, 08:29 AM
  4. Look up values in multiple table fields
    By nmcentire in forum Programming
    Replies: 2
    Last Post: 11-12-2010, 02:02 PM
  5. Replies: 5
    Last Post: 09-14-2010, 09:50 PM

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