Results 1 to 10 of 10
  1. #1
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568

    access cannot find a record with key matching change information

    Hi Guys,

    my relationships:
    Click image for larger version. 

Name:	relationship.png 
Views:	19 
Size:	33.3 KB 
ID:	31068

    my subform is based on query :
    Click image for larger version. 

Name:	query.png 
Views:	19 
Size:	30.6 KB 
ID:	31066

    and if i want to write date into first column of query (Data_korekrty) and try to exit from current record on subform there is an error:
    "access cannot find a record with key matching change information"

    Click image for larger version. 

Name:	matching keys.png 
Views:	19 
Size:	24.6 KB 
ID:	31067

    I know what is causing the problem.
    Problem is connected with tbl_causes table. First i should input Cause from tbl_cause and second other fields.
    How to solve the problem?

    Maybe i should force user to first input data into Cause field? How to do it?
    How can i solve it?

    My subform child field: Korekty_ID_FK , parent field: Korekty_ID.



    Please help,
    Jacek

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    you have a very hairy join.
    Start with 2 tables. Test query, If that works, then join another table,
    test query ,continue until you loose data. Then you found the problem.

  3. #3
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Hi ranman256.

    Process is demanding

    I started with 2 tables:

    tbl_causes and tbl_Daty.

    Is it 1 to many relationship.

    I created Qry1 in order to show you where the problem occurs.

    Click image for larger version. 

Name:	QryImage.png 
Views:	16 
Size:	25.1 KB 
ID:	31071


    If i am trying to input Data_korekty there is error: i have to input Cause_ID_FK and then i can input date into query.

    Sample database i attached.

    So user has to input first Cause_ID_Fk. How to avoid this on subform datasheetview?

    Jacek
    Attached Files Attached Files

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Just having relationships joining tables does not move or input data into those tables. Use the LinkMaster (put Cause_ID) and LinkChild(Cause_ID_FK) properties on subform, then when you enter the date it should also copy the Cause_ID to Cause_ID_FK.

  5. #5
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Thank you Bulzie.

    I do not know what exactly you meant.

    I created sample database to show you what i want to achive.
    Click image for larger version. 

Name:	Przechwytywanie.JPG 
Views:	16 
Size:	29.5 KB 
ID:	31073

    I createa table tbl_Corrections.
    And now I am creating form using this table, creating also subform from my query and linking it :
    LinkMaster - ID_Korekty
    LinkChild -
    Korekty_ID_FK

    It is ok but still i have to first input into query subform Cause_ID_FK...

    How can i solve this?

    Thank you for your help
    Jacek

  6. #6
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Anyone please,

    Jacek

  7. #7
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Hi Guys,

    i discovered very strange thing.

    In my previous database i have 1 to many relationship like here:
    Click image for larger version. 

Name:	Qry1.png 
Views:	9 
Size:	19.0 KB 
ID:	31105

    And now result of query:
    Click image for larger version. 

Name:	Qry1Result.png 
Views:	9 
Size:	12.6 KB 
ID:	31106

    If i input clientFirstName for example NEW NAME automatically there will tblClientTypes.ClientTypeID and tblClients.ClientTypeID assigned.
    Sample database in attachment.

    Here in my current database i did the same query based on one to many relationship:
    Click image for larger version. 

Name:	Qry3.png 
Views:	10 
Size:	18.8 KB 
ID:	31108
    Click image for larger version. 

Name:	Qry3.png 
Views:	10 
Size:	9.9 KB 
ID:	31110

    I added here also NEW Name (in Uwagi field - string field) and only Korekty_ID key appeared.
    What about Korekty_ID_FK? Why is it no appearing? What is causing this?

    thank you for your help,
    warm regards,
    Jacek Antek
    Attached Files Attached Files

  8. #8
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You seem to have many threads going on this subject. Remember, data must be added to records somewhere, unless you specify a default value in table design it has to be added manually, Access will not automatically put the FK value in.

  9. #9
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    You can have 2 fields in the Link lines so maybe:

    LinkMaster - ID_Korekty, Cause_ID
    LinkChild -
    Korekty_ID_FK, Cause_ID_FK

    Just make sure Cause_ID along with ID_Korekty are somewhere in the main form also(if you don't want it to show make it invisible).






  10. #10
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Thank you Guys,

    i solved the problem:

    Click image for larger version. 

Name:	tytulak.png 
Views:	5 
Size:	57.0 KB 
ID:	31128

    I used subform and one more subsubform within subform
    And now is working like a charm,

    thanks !

    Jacek

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

Similar Threads

  1. Replies: 2
    Last Post: 03-25-2016, 01:52 PM
  2. Replies: 3
    Last Post: 05-28-2015, 01:32 PM
  3. Replies: 8
    Last Post: 05-05-2012, 02:01 PM
  4. Replies: 1
    Last Post: 10-24-2011, 08:01 AM
  5. Replies: 1
    Last Post: 08-11-2011, 11:33 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