Results 1 to 7 of 7
  1. #1
    ryantam626 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    10

    Adding record to subform on exit of main form and no repeat record in subform

    Hi there!
    I want to add a record to a subform when save a record on the main form, additionally I want the subform to have no repeated record. ie. when people edit a record it wont add another record to the subform on exiting the main form. Is that possible?
    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I don't understand. Why would a record in subform need to be automatically created when saving record on main form? Why would editing a record (in main form?) add another record to subform?

    This all sounds like could get very complicated.
    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
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    You can easily differentiate between a Record that has just been created and one that has simply been edited, but as June7 has said, your need to create a New Record in the Subform when creating a New Record in the Main Form is, to say the least, odd! You really need to give us more of an idea as to exactly what you're trying to do, here.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    ryantam626 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    10
    Hmmm. Let me try to explain my situation with pictures.

    Pic.zip

    In Progress form, user will enter data obviously. Data will be stored in three tables, [Progess Table],[Machine Work-Progress Table] and [Staff Work-Progess Table].
    By using the report generator, a crosstab query is created using the field in the generator as criterion.
    The crosstab query will then create a report. Here comes my ultimate goals, I want a grand total for each day and a running total in the report.
    So I thought if I could add a record with the [Machine Designation]="Total" in [Machine Work-Progress Table], then in the crosstab query a column of Total will appear and the correct total will be shown. And the running total in the report is just sum of the "Total" column.

    I do know the total column in a report can be done manually, but I am looking for a solution that can reduce users work.
    One more question, using a macro to add a running total in a report in possible right?

    Thanks again

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    A crosstab query can by design generate a 'Total' column that will be a sum of the other data fields for each record.

    I don't understand the following.
    How would a total column in a report be done 'manually' - with an expression in a textbox?
    How would a macro add a running total in a report?
    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
    ryantam626 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    10
    How would a total column in a report be done 'manually' - with an expression in a textbox? Yes.
    How would a macro add a running total in a report? I don't know yet, haven't begun to attempt it, but according to some guide online, a running total column is possible.
    A crosstab query can by design generate a 'Total' column that will be a sum of the other data fields for each record. I just discovered it using the wizard too haha. Thanks

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Report textbox has a RunningSum property. Has nothing to do with code - macro nor VBA.
    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. Replies: 14
    Last Post: 05-25-2012, 02:40 AM
  2. Replies: 4
    Last Post: 03-14-2012, 10:08 AM
  3. Replies: 11
    Last Post: 02-13-2012, 10:06 AM
  4. Replies: 13
    Last Post: 01-29-2012, 01:45 PM
  5. Replies: 2
    Last Post: 12-07-2011, 02:51 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