Results 1 to 4 of 4
  1. #1
    Degs29 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    38

    Sub-Subform with identical fields not showing unique data.

    Let me explain. I'm trying to track worklog data, which resulted in a form-->subform-->sub-subform format data-entry system.

    WorkLog [Main form] (View=Single):
    -Client
    -JobNbr [Primary Key]
    -InvoiceDate
    -OrderStatus

    DateLog [Subform] (View=Single):

    -JobNbr (Invisible; for linking to form)
    -Date [Primary Key]

    HourLog [Sub-Subform] (View=Continuous):
    -Date (Invisible; for linking to subform)
    -ID (autonumber) [Primary Key]
    -Employee
    -Type (Overtime or Regular)
    -HoursLogged

    There are many records in the sub-subform for each record of the subform, and likewise many records in the subform for each record in the main form.

    What I'm running into is this: when two unique main form records happen to have the same date in their respective subform, the info in the sub-subform is used for both records, when I need them to be unique.

    To make it more clear, I have an example. Below, you'll find the exact order of how I entered data into the form:


    WorkLog:
    (1st record)
    Client: ABC
    JobNbr: 123
    InvoiceDate: <remains blank until invoiced>
    Status: Incomplete

    DateLog:
    (1st record)


    Date: Apr. 24/13

    HourLog:
    (1st record)
    Employee: AA
    Type: REG
    Hours: 7

    (2nd record)
    Employee: BB
    Type: REG
    Hours: 3

    DateLog:
    (2nd record)
    Date: Apr. 25/13

    HourLog:
    (1st record)
    Employee: BB
    Type: REG
    Hours: 4

    WorkLog:
    (2nd record)
    Client: ABC
    JobNbr: 456 <-------------------------- Note: New job number
    DateInvoiced: <blank>
    Status: Incomplete

    DateLog:
    (1st record)
    -Date: Apr 25/13

    As soon as I type in Apr. 25/13, data from the same date, but from the previous job #123 fills in the HourLog. I need this data to be unique for each job #.

    Thanks for any help!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    What causes the data to fill in?

    Can you change the data?

    Want to provide db for analysis? Follow instructions at bottom of my post.
    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
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    DateLog [Subform] (View=Single):
    -JobNbr (Invisible; for linking to form)
    -Date [Primary Key]

    Something screams problem about this. Primary key is Date? Meaning you can only have one record in that table each day. (unless it's really a timestamp).

    Suggestions -

    First, change the name of DateLog.Date to DateLog.WorkDate. Avoid using "Date", it's a reserved word.

    Second, create an autokey field on DateLog. For grins, we'll call it WorkDateID.

    Third, Change HourLog.Date to HourLog.WorkDateID and adjust the foreign key reference.

    Finally, fix the queries and the link fields in your forms.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    The Link Master Fields/Link Child Fields between DateLog and HourLog needs to be JobNbr and Date. In Properties - Data for the HourLog, if you click on the ellipsis (...) a dialog box will pop up letting you list multiple fields to link on.

    BTW, Date is a Reserved Word, in Access, and should never be used as the name of a Field/Control; best change this to something else.

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

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 6
    Last Post: 04-24-2013, 03:19 PM
  2. consolidate data from two identical databases
    By amd711 in forum Import/Export Data
    Replies: 1
    Last Post: 11-04-2012, 12:43 AM
  3. Replies: 2
    Last Post: 05-02-2012, 09:16 PM
  4. Replies: 3
    Last Post: 12-10-2009, 02:16 PM
  5. One table multiple fields identical properties.
    By swampdonkey in forum Queries
    Replies: 2
    Last Post: 09-29-2006, 10:53 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