Consulting

Results 1 to 7 of 7

Thread: Adding New Data to an Existing Record

  1. #1

    Adding New Data to an Existing Record

    I am working on a database with two related tables - similar to a database that has one table with a list of clients and a related table that holds each client's order.

    My primary table tracks the progress of our company projects through a series of processes across different business areas. The second table (an actions table) has been designed to provide additional information for a specific department and the actions taken by this department for each company project . For any particular project, there will be multiple actions.

    I have created a primary form that will display the details of the primary table (which, again, tracks the life of a project). I have added a control on this main form to open an actions form.

    HERE'S WHERE I'M STUCK.

    I need the actions form to open as a new record for the currect project.

  2. #2
    VBAX Expert Imdabaum's Avatar
    Joined
    Jun 2006
    Posts
    652
    Location
    I think in the properties of the Action form you should be able to set Allow Additions to Yes, and all other allows to No in order to force the form to only show new records.
    Someday I'll understand everything...
    Even then...I'll still pretend I'm a beginner.

  3. #3
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,675
    Location
    Actually you can just set the Data Entry property of the form to True- this makes it into a data entry only form- it will always open to a New record. Using Data Entry means you cannot use it to show existing records.
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


  4. #4
    VBAX Expert Imdabaum's Avatar
    Joined
    Jun 2006
    Posts
    652
    Location
    Ahh. Thanks Cregan.
    Someday I'll understand everything...
    Even then...I'll still pretend I'm a beginner.

  5. #5
    OK, I've set the data entry field to "yes" on the second form. Thanks.

    How do I get it to recognize the current project? I need to add new entries for the project at hand.

  6. #6
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,675
    Location
    Quote Originally Posted by nardella
    How do I get it to recognize the current project? I need to add new entries for the project at hand.
    I have no idea what you mean by this. Can you explain?
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


  7. #7
    There are many ways to do this. Here is one:

    If you're opening up your Actions form from your Primary form (and leaving the Primary form open) you can use the "before insert" event on your Actions form to set a bound field of your unique project id to the value of your project id on the Primary form.

    Here is basically what the "before insert" code would look like:

    Forms!Actions!ProjectID = Forms!Primary!ProjectID

    That should ensure it inserts a new record with the correct project ID.

Posting Permissions

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