Access retrieving record incorrectly

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    Access retrieving record incorrectly

    Hi

    Bit of an unusual one. I have an Access front end. Two tables
    tblHeader and tblDetails. Each has an ID field (unique and primary)
    plus other fields as necessary.

    On aform is 3 fields from the header:
    1. A text field
    2. A SupplierID field (combo dropdown)
    3. A SupplierBranchI D field (combo dropdown)

    The form is opened in "Add Only" mode.

    I enter "abc" in the text field and choose a supplier and branch. I
    then go to the sub-form (attached to tblDetails) and enter some
    details.

    I can happily close the form.

    If I open the form again (as above - Add Only mode), and put abc into
    the text field and choose the same supplier and branch, then the
    previous header is retrieved (which has "abc" in the text box, and the
    same supplier and branch), even though I want a "new" header record. A
    new header record *is* created, but not "used" (ie tblDetails has the
    "old" headerID inserted into it, rather than the "new" one.)I could
    also put in other records in between, but it always goes to the last
    record, with that same data in those three fields.

    Does this make sense? (considering that tblHeader has a uniquie ID
    field)

    Can anybody think of why/how this could happen. If I "uniquify" the
    text (eg add the date/time to it) then it is fine.

    Help!

    Regards,
    Mark ...
Working...