Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2002

    Unanswered: many tables in a form--button to submit to one table

    My boss has asked me to create a system for her to track her daily tasks (I'm just an assistant, and a Flash/HTML guy).

    Each of her tasks has it's own set of fields, so I've created tables for each task.

    I created a query with all the fields of all the tables.

    Now, I've created a form out of the query.

    Most are single entries each day, but with some of the tasks, there are multiple entries for each session (once daily for the form), and she needs to be able to add a record for the table that the task is built out of, without forwarding a whole new record in the query (I'm hoping I can get it so there can only be one record for each day).

    What I've done, is for all these tasks (in their own tables) added a button that adds a new record, but it's adding a record to the whole query thing, not to the table I want, when clicked. I'm guessing I have to assign each button to update a particular table on a click event? No idea how to do that, don't know VBA (yet).

    I don't understand how to get the 3 or 4 buttons to add records to the table itself (for future reference in her 3 month reports) because they're all adding a whole record to the whole form-don't know how to designate each button to a particular table and update with one record to that table.

    Make sense? I hope so...any help would be appreciated.


  2. #2
    Join Date
    Jul 2002
    ps, I'll ftp the file if it helps. shawn

  3. #3
    Join Date
    Jul 2002
    Shawn, I think you may need to look at your database structure.

    Firstly, a few questions:
    Do you store similar information about each task, irrespective of the type of task?
    What did you mean by each session? Do you mean each time she accesses the databaase?

    Assuming the answer to the first question is yes, may I propose a slightly different structure:

    ID (PK)
    IDTaskType (FK)

    IDTaskType (PK)

    Assuming each task will store similar information, such as 'StartTime', 'FinishTime' etc, you can store them all in the same table. DateOfTask should hav a default value of date() so that newly created tasks will automatically record the date they were added.

    You'll notice a field called 'IDTaskType' which is related to the table tblTaskTypes. This table holds one entry for each possible type of task (such as 'Print Sales Report' or 'Take dog for walk' etc.)

    So onto the form:
    You basically only need to base this on a query which holds the fields from tblTasks. The form should be in datasheet or continuous form view.

    Now you'll obviously only want to show the task from 'today' and so should filter those records so that the 'DateOfTask' field = todays date. As long as you set the 'Allow Additions' property of the form to Yes then creating a new task is a simple as going to the bottom of the list or clicking new record from the menu.

    Hope this helps,
    Last edited by Bunce; 07-10-02 at 06:13.
    There have been many posts made throughout the world.
    This was one of them.

  4. #4
    Join Date
    Jul 2002
    Thanks Bunce. I've been studying this thread. I redesigned the bottom end into one table, comprised of all the fields.

    What it is, is once a day, for example at the end of the day, she goes in and types what she did for the day. She needs to be able to generate a report every three months based on her daily entries.

    I'm hoping for a file somewhere that has a single entry for each day of the year, but in that entry there may be multiple entries for any given 'set' of fields. I've ftped the form, and maybe you can guide me based on the visual:

    I appreciate any advice, as this really isn't my specialty at all. Only the first button has it's event 'working' and it adds a record to the whole form, not just the set of fields I'm trying to relate it to.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts