Page 1 of 2 12 LastLast
Results 1 to 15 of 30
  1. #1
    MatthewR is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    118

    Unhappy Record Not Appearing in Form

    I have a form named EDIT INCIDENT that is linked to a table that is named FATAL INCIDENTS. But when I enter a new record into the FATAL INCIDENTS table, it is not appearing as a record in the EDIT INCIDENT form.



    However, there is another table called EVENT INFORMATION, which is related to FATAL INCIDENTS. The primary key for the FATAL INCIDENTS table is a foreign key in the EVENT INFORMATION table.

    And I've found that once I create a record in EVENT INFORMATION that corresponds to the new record in FATAL INCIDENTS, then the problem goes away. That is, the EDIT INCIDENT form then happily displays the new record.

    Why is this happening? Why is the record not appearing in the EDIT INCIDENT form right away? Please help!

  2. #2
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    It's happening because of the way you have it designed:

    [EVENT INFORMATION]>[FATAL INCIDENTS]>[EDIT INCIDENT]

    With this structure, how could you have a record in EDIT INCIDENT if the parent record does not exist in EVENT INFORMATION?

    You can post DB for analysis, or if you could provide more info about the forms and relationships. Maybe post a picture of your relationships, and a picture of your form. Or you can post your DB.

  3. #3
    MatthewR is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    118
    Cbende,
    Thanks very much for your reply, and apologies for my delayed response.

    I believe that FATAL INCIDENTS is the parent table, not EVENT INFORMATION. Hence, my confusion.

    The site won't let me upload the database because it's too big, so I've uploaded screen shots of the Relationships and the Form.

    I think I've managed to pinpoint the source of the problem, but I'm still not sure how to fix it.

    Even though all of the fields in the EDIT INCIDENTS form come from the FATAL INCIDENTS table, for some reason, the Record Source property for the form is:

    SELECT [FATAL INCIDENTS].*, [EVENT INFORMATION].Incident FROM [FATAL INCIDENTS] INNER JOIN [EVENT INFORMATION] ON ([FATAL INCIDENTS].[Fatal Incident #] = [EVENT INFORMATION].Incident);

    I tried changing the Record Source to just FATAL INCIDENTS, but then when I try to search for a record in the EDIT INCIDENTS form, it gives me an error message, which I've also attached.

    Any thoughts? Again, thanks so much for your help.

    Click image for larger version. 

Name:	Relationships Screen Shot.jpg 
Views:	9 
Size:	145.7 KB 
ID:	21071Click image for larger version. 

Name:	Edit Incident Form View Screen Shot.jpg 
Views:	9 
Size:	98.2 KB 
ID:	21072Click image for larger version. 

Name:	Edit Incident Design View Screen Shot.jpg 
Views:	9 
Size:	171.2 KB 
ID:	21073Click image for larger version. 

Name:	Error Message Screen Shot.jpg 
Views:	9 
Size:	139.7 KB 
ID:	21074

  4. #4
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Hmmm, I'm not sure why you're getting the error.

    Could you please attach DB for analysis.

    Send DB to Zip file>Go Advanced(located next to quick reply)>attachment>select file>upload>Insert Inline.

  5. #5
    MatthewR is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    118
    Okay. I've attached it.

    Thanks!
    Attached Files Attached Files

  6. #6
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Why do you have [EVENT INFORMATION].Incident as part of your query?

    Removing [EVENT INFORMATION] table from your query gives you all you're records.

  7. #7
    MatthewR is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    118
    Which query are you referring to?

    (Please pardon my ignorance- I'm new to Access.)

  8. #8
    MatthewR is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    118
    Are you talking about the Record Source Property for the form?

    If so, what should the Property be set to? I'm not exactly sure how to write it.

  9. #9
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Yes, the Record Source Property.

    Just simply delete the [EVENT INFORMATION] table from it.

    If you click the elipse(...) next to Record Source, the design view of SQL will pop up. Right click [EVENT INFORMATION] table and delete it.

  10. #10
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    The reason why not all of your records from FATAL INCIDENTS were showing up is because you had the table EVENT INFORMATION as part of the query, and you had EVENT INFORMATION.Incidents in your query. Therefor, only records that are present in both tables would show up. So if you didnt have a record in EVENT INFORMATION that was not linked to FATAL INCIDENTS, then it would not show up in your EDIT INCIDENT Form.

    Hope that explanation helps!

  11. #11
    MatthewR is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    118
    Okay, cool. I did that, and now I see that all the records for EDIT INCIDENT are there.

    At the same time, that created a separate problem for me. Now, when I try to use my combo box to open and search the EDIT INCIDENT form, I get that "Enter Parameter Value" error message again- the one I attached to my earlier post.

    The Combo Box is on the HOME PAGE form in the ADD/EDIT DATA subform. The Combo Box is unbound, with a row source of:
    SELECT [FATAL INCIDENTS].[Fatal Incident #], [FATAL INCIDENTS].[Incident Date], [FATAL INCIDENTS].[Short Address] FROM [FATAL INCIDENTS] ORDER BY [Incident Date] DESC;

    The button that says "Edit Incident Information" has the following code for On Click:
    Private Sub Command85_Click()
    DoCmd.OpenForm "EDIT INCIDENT", , , "Incident=" & Me.Incident.Value
    End Sub

    So now, when I click on that button, I get that error and I don't quite understand why. Do you know why that is?

    I feel like the solution to this is staring me in the face, but I just can't see it.

    Thanks very much.

  12. #12
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Matthew, I'll get back with you in an hour.

  13. #13
    MatthewR is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    118
    Okay, no problem. Take your time please.

    I really appreciate your help.

  14. #14
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    MatthewR, I'm not really sure how to solve the problem, was this working before the other change we made?

  15. #15
    MatthewR is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    118
    Yeah, it was working before.

    At the same time, I feel like this problem is probably less difficult for me to solve on my own with some further research, compared to the original problem.

    So, if you're not sure what to do about this, it's cool. I feel as though we've still made progress here.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 02-10-2014, 08:23 PM
  2. New Employee not appearing in form
    By Canadiangal in forum Forms
    Replies: 1
    Last Post: 06-09-2013, 05:15 PM
  3. Text appearing every time form is opened.
    By lmjje in forum Programming
    Replies: 2
    Last Post: 01-04-2013, 09:25 AM
  4. Replies: 6
    Last Post: 06-17-2011, 08:40 AM
  5. Replies: 5
    Last Post: 08-13-2010, 07:26 PM

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